Skip to main content

Module memory

Module memory 

Source

Structs§

AllocatorMemorySnapshot
AllocatorPressureRelief
MemoryEstimate
A cold-path estimate of memory AFT can attribute without allocator hooks.
MemorySnapshot
ProcessMemorySnapshot
RootMemorySnapshot
SqliteMemorySnapshot

Enums§

AllocatorSource

Constants§

ALLOCATOR_SLACK_RELIEF_MIN_INTERVAL
Minimum spacing between opportunistic relief passes so a workload that legitimately cycles through large allocations does not thrash the allocator.
ALLOCATOR_SLACK_RELIEF_THRESHOLD_BYTES
Allocator slack (mapped-but-unused arena bytes) above which opportunistic pressure relief is worth the zone-lock contention it briefly causes.
MEMORY_SNAPSHOT_ROOT_DETAIL_CAP
Cap on per-root detail entries in serialized snapshots. Process totals always cover every root; only the per-root breakdown is capped so a many-root daemon process cannot balloon the status payload past downstream consumers’ size limits (the daemon metrics cache truncates around 27 KB, and JSON keys serialize alphabetically, so an oversized memory.roots map pushes later sections past the cut).

Functions§

allocator_slack_relief_due
Decide whether an opportunistic allocator relief pass is due.
cached_allocator_observation
Return the last process-wide allocator observation without walking allocator zones. The observation timestamp is separate from the sampler reservation so a status request never mistakes an in-progress sample for a fresh reading.
estimated_json_bytes
last_allocator_relief_at_ms
last_allocator_relief_freed_bytes
path_bytes
relieve_allocator_pressure
spawn_allocator_slack_relief_if_due
Opportunistically return unused allocator pages without reading allocator statistics on the module loop. The loop only reads cached atomics. When the cached observation is stale, one sampler takes an initial snapshot; if it finds enough slack, the page-return operation reuses it and takes only one additional after snapshot, limiting the pass to two statistics walks.
usize_to_u64