Skip to content

Measure the heap size of values

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

servo/malloc_size_of

Repository files navigation

MallocSizeOf

Build Status Crates.io Docs Crates.io License dependency status

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. HashSet and HashMap. (This relies on the heap allocator having suitable support, which jemalloc has.)
  • It allows handling of types like Rc and Arc by providing traits that are different to the ones for non-graph structures.

About

Measure the heap size of values

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published

Languages