pub struct SystemMemoryStats {
pub rss_bytes: usize,
pub allocated_bytes: usize,
pub active_bytes: usize,
pub mapped_bytes: usize,
pub retained_bytes: usize,
pub fragmentation_ratio: f64,
}Expand description
System memory statistics from jemalloc.
Fields§
§rss_bytes: usizeResident Set Size — actual physical memory used.
allocated_bytes: usizeTotal bytes allocated by the application.
active_bytes: usizeTotal bytes in active pages (mapped and potentially dirty).
mapped_bytes: usizeTotal bytes mapped by the allocator (may exceed active).
retained_bytes: usizeTotal bytes retained in the allocator’s caches.
fragmentation_ratio: f64Fragmentation ratio: (active - allocated) / active.
Measures how much memory the allocator has claimed from the OS (active pages) but isn’t actually used by application objects. This gap comes from jemalloc internal metadata, free-list fragmentation, and thread cache overhead.
Healthy: < 0.15 (15%). Warning: 0.15–0.25. Critical: > 0.25. A sustained ratio above 0.25 indicates severe fragmentation — the process is consuming significantly more RSS than its live data warrants, and OOM risk increases under memory pressure.
Implementations§
Trait Implementations§
Source§impl Clone for SystemMemoryStats
impl Clone for SystemMemoryStats
Source§fn clone(&self) -> SystemMemoryStats
fn clone(&self) -> SystemMemoryStats
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more