Expand description
The glibc arena cap the daemon starts under, and 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++ libraries that use malloc (onnxruntime, sqlite) get their
memory; usearch maps its own tapes, which the component report counts.
Structs§
- Heap
Report HeapStatsplus where the anonymous resident set goes, per component.- Heap
Stats
Constants§
Functions§
- arena_
mappings - cap_
arenas - Caps glibc at
ARENA_CAPmalloc arenas unlessMALLOC_ARENA_MAXis set. Threads that already allocated keep their arena, so call it before any thread starts. - component_
residency - heap_
report - Takes the reader index lock briefly, so call it off the async runtime.
- heap_
stats - record_
index_ writer - What the drain loop’s writer
Indexesholds, orNonewhile it is released. Process-wide, like the RSS it is compared against.