Skip to main content

Module heap

Module heap 

Source
Expand description

Allocator residency accounting for /v1/status.

The daemon runs under a hard MemoryMax and has twice been cgroup-OOM- killed on anonymous RSS with no retained structure anywhere near the size of the resident set: the store holds ~12k memories (~18 MB of embeddings) while RSS sits above 1.7 GB. Anonymous RSS alone cannot say whether those bytes are live data or memory the allocator has taken from the kernel and not given back, and that distinction picks the remedy: freed-but-retained bytes point at glibc’s per-thread arenas, whose non-main arenas only ever trim their top chunk, while live bytes point at a working set that simply does not fit the cap.

mallinfo2 aggregates every arena, and glibc is where both the Rust side and the C/C++ side (onnxruntime, usearch, sqlite) get their memory, so a single reading covers the whole process.

Structs§

HeapStats

Functions§

arena_mappings
heap_stats
rss_anon_bytes