Expand description
Resident Set Size (RSS) sampling for memory diagnostics.
Used by the allocator benchmark (vtcode bench-allocator) to measure whether
the global allocator returns memory to the OS after bursty/sparse workloads.
Unlike performance_profiler::get_memory_usage_mb (Linux /proc only, fake
fallback on macOS), this returns a real value on every supported platform.
Functionsยง
- resident_
set_ size_ mb - Returns the current process Resident Set Size in megabytes, or
Noneif it cannot be determined on the current platform. - sample_
peak_ rss_ mb - Sample RSS repeatedly, returning the maximum observed value in MB. Useful for capturing peak memory during a burst of activity.
- sample_
rss_ mb - Sample RSS once and return the value in MB (0.0 if unavailable).