Expand description
Allocation profiling and Linux memory telemetry for Rust services.
pprof-alloc provides a GlobalAlloc wrapper that can sample allocation
stack traces and export them as gzipped pprof heap profiles. It also exposes
Linux memory collectors for allocator state, cgroup v2 memory accounting, and
/proc/self/smaps_rollup process residency.
The crate is intended to be embedded in binaries that expose their own debug
or metrics endpoint. Use PprofAlloc as the process global allocator, then
call generate_pprof or snapshot from your application surface.
Modules§
Macros§
Structs§
- Memory
Snapshot - Best-effort snapshot of allocation and memory state for the current process created by
snapshot(). - Pprof
Alloc - Global allocator wrapper that can collect allocation counters and pprof heap profiles.
- Pprof
Summary - Summary of the currently recorded pprof allocation profile.
Enums§
Constants§
- DEFAULT_
PPROF_ SAMPLE_ RATE - Default average number of allocated bytes between recorded pprof samples.
- PPROF_
SAMPLE_ RATE_ ENV - Environment variable read by
PprofAlloc::with_pprof_sample_rate_from_env.
Functions§
- allocation_
stats - Return a snapshot of coarse process-wide allocation counters.
- capture_
mode - Return the stack capture mode compiled into this build.
- generate_
pprof - snapshot
- Capture a best-effort process memory snapshot.