system_alloc_stats provides a wrapper around the System
allocator, exposing some of its runtime statistics.
use system_alloc_stats::SystemWithStats;
#[global_allocator]
static SWS: SystemWithStats = SystemWithStats;
fn main() {
(...)
println!("current heap use: {}; average allocation size: {}", SWS.use_curr(), SWS.alloc_avg());
(...)
}