hyperi-rustlib 2.8.1

There's plenty of sage advice out there about how to run Rust services in production at scale — config cascades, structured logging, masking secrets, multi-backend secrets management, Prometheus, OpenTelemetry, Kafka transports, tiered disk-spillover sinks, adaptive worker pools, graceful shutdown — but almost none of it as code you can just install and use. This is that code. Opinionated, drop-in, working out of the box. The patterns from blog posts, watercooler chats and beers with your Google mates as actual library — not a framework you assemble from twenty crates and 8 weeks of munging.
Documentation
// Project:   hyperi-rustlib
// File:      src/memory/mod.rs
// Purpose:   Memory management and OOM prevention
// Language:  Rust
//
// License:   BUSL-1.1
// Copyright: (c) 2026 HYPERI PTY LIMITED

//! Memory management and OOM prevention.
//!
//! Provides cgroup-aware memory tracking with backpressure signals
//! for Kubernetes-deployed services. Prevents OOM-kills by applying
//! backpressure before hitting the container memory limit.
//!
//! # Architecture
//!
//! ```text
//! Layer 1 (opt-in): Cap allocator -- hard limit, last-resort crash instead of OOM-kill
//! Layer 2 (default): MemoryGuard -- cgroup-aware tracking, backpressure signals
//! ```

pub mod cgroup;
pub mod guard;

pub use cgroup::detect_memory_limit;
pub use guard::{MemoryGuard, MemoryGuardConfig, MemoryPressure};