Measure the heap size of values
- Rust 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| malloc_size_of | ||
| malloc_size_of_derive | ||
| .gitignore | ||
| Cargo.toml | ||
| LICENSE-APACHE | ||
| LICENSE-MIT | ||
| README.md | ||
MallocSizeOf
A an allocator-agnostic crate for measuring the runtime size of a value including the size of any heap allocations that are owned by that value.
This crate is used by both Servo and Firefox for memory usage calculation.
Features
- It isn't bound to a particular heap allocator.
- It provides traits for both "shallow" and "deep" measurement, which gives flexibility in the cases where the traits can't be used.
- It allows for measuring blocks even when only an interior pointer can be
obtained for heap allocations, e.g.
HashSetandHashMap. (This relies on the heap allocator having suitable support, whichjemallochas.) - It allows handling of types like
RcandArcby providing traits that are different to the ones for non-graph structures.