Expand description
Process-level RAM guardian with adaptive eviction.
Monitors RSS via platform-specific APIs and triggers tiered cache eviction when memory usage exceeds configurable thresholds (default: 5% of system RAM).
Structs§
- Memory
Snapshot - Snapshot of current memory state for diagnostics.
Enums§
Functions§
- force_
purge - Force immediate purge of all caches and jemalloc arenas.
- get_
rss_ bytes - Current process RSS in bytes, or
Noneif unavailable. - get_
system_ ram_ bytes - Total physical RAM in bytes, or
Noneif unavailable. - jemalloc_
purge - Force-purge all jemalloc arenas to return memory to the OS.
- peak_
rss_ bytes - Recorded peak RSS since process start.
- rss_
limit_ bytes - Returns the RSS limit in bytes based on
max_ram_percentconfig. - start_
guard - Start the background memory guardian task (idempotent).