#allocator #heap #heap-memory #memory

system_alloc_stats

A wrapper exposing some stats for the System allocator

1 unstable release

0.1.0 Aug 11, 2023

#590 in Memory management

CC0 license

13KB
216 lines

system_alloc_stats

crates.io docs.rs actively maintained

system_alloc_stats provides a wrapper around the System allocator, exposing some of its runtime statistics.

Usage

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());
    (...)
}

Dependencies

~150KB