malloc_size_of

Crates.iomalloc_size_of
lib.rsmalloc_size_of
version
sourcesrc
created_at2025-02-07 23:53:19.813487+00
updated_at2025-02-25 23:42:09.571444+00
descriptionA an allocator-agnostic crate for measuring the heap size of a value
homepage
repositoryhttps://github.com/servo/malloc_size_of
max_upload_size
id1547552
Cargo.toml error:TOML parse error at line 19, column 1 | 19 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
Martin Robinson (mrobinson)

documentation

README

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.
Commit count: 50

cargo fmt