workflow_perf_monitor/mem/mod.rs
1//! This sub-mod provides some facilities about memory performance profiling.
2//! # Memory usage of current process
3//! There's a platform-related function called `get_process_memory_info` available on MacOS and Windows.
4//! # Memory usage of ALL Rust allocations
5//! We provide a `CountingAllocator` that wraps the system allocator but tracks the bytes used by rust allocations.
6//! This crate DOES NOT replace the global allocator by default. You need to make it as a `global_allocator` or enable the `allocation_counter` feature.
7//! ```ignore
8//! #[global_allocator]
9//! static _COUNTER: perf_monitor::mem::CountingAllocator = perf_monitor:mem::CountingAllocator;
10//! ```
11
12mod allocation_counter;
13
14pub use allocation_counter::CountingAllocator;
15
16mod process_memory_info;
17pub use process_memory_info::{get_process_memory_info, ProcessMemoryInfo};
18
19#[cfg(target_os = "macos")]
20pub mod apple;