Skip to main content

JemallocStatsSource

Trait JemallocStatsSource 

Source
pub trait JemallocStatsSource: Send + Sync {
    // Required method
    fn read(&self) -> JemallocStats;
}
Expand description

“What does jemalloc say about our memory usage right now?”

Implementations must be cheap (the budget calls JemallocStatsSource::read once per tick). Returning all-zeros is a valid answer for builds that do not use jemalloc.

Required Methods§

Source

fn read(&self) -> JemallocStats

Read the current stats. Implementations are free to cache the epoch handle, but should call epoch.advance (or equivalent) before reading so the returned values reflect the current state and not the values from the previous epoch.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§