Skip to main content

Module memory

Module memory 

Source
Available on crate feature memory only.
Expand description

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

Layer 1 (opt-in): Cap allocator -- hard limit, last-resort crash instead of OOM-kill
Layer 2 (default): MemoryGuard -- cgroup-aware tracking, backpressure signals

Re-exports§

pub use cgroup::detect_memory_limit;
pub use cgroup::detect_memory_pressure;
pub use guard::MemoryGuard;
pub use guard::MemoryGuardConfig;
pub use guard::MemoryPressure;
pub use guard::set_heap_source;

Modules§

cgroup
Cgroup-aware memory limit detection.
guard
Memory guard with backpressure signals.