Expand description
srv’s own memory, and what holds it: one report, logged every few minutes and served to
muxspect memory.
Three things are read side by side, because the question on a machine where srv has grown large is which of them the memory is in:
- What the operating system has given the process (
process). - What srv has allocated and not freed (
alloc). Committed memory far above this is memory the heap keeps after it was freed, and no structure holds it. - The structures known to grow with use, each with its count and an estimate of its bytes
(
Held). Live bytes far above their sum is a structure this census does not know.
The bytes of a structure are an estimate: the content of its strings and JSON values plus the room its lists reserve, not the allocator’s rounding. Taking the census walks each structure under its own lock, one at a time; the report says how long that took.
Report: docs/reports/REPORT_SRV_MEMORY_UNDER_400MB_2026_12_01.md (step 0 of its plan).
Modules§
- alloc
- How much the process has allocated and not freed.
- process
- What the operating system says about this process: memory, threads, handles.
Structs§
Constants§
- FIRST_
REPORT_ AFTER - The first report comes this long after start, when the windows and agents are restored.
- LOG_
TARGET - The log line’s target:
muxlog srv grep srv_mem. - REPORT_
EVERY - Then one report per interval. The census walks every kept event, so it is not taken every few seconds; a day of use still gives 288 readings.
Functions§
- collect
- Take a reading. Blocking work (a walk of every counted structure, each under its own lock): call it from the blocking pool.
- json_
bytes - An estimate of the heap bytes behind a JSON value (not the
Valueitself, which its holder counts): string text, array slots and object entries, all the way down. - log
- Write the reading as one log line.
- subagent_
event_ bytes - An estimate of the heap bytes behind one subagent event.