#memory-profiling #heap-size #memory-usage

no-std size-of

A crate for measuring the total memory usage of an object

6 releases

0.1.5 Feb 23, 2023
0.1.4 Nov 4, 2022
0.1.3 Oct 21, 2022
0.1.1 Sep 14, 2022

#218 in Profiling

Download history 13388/week @ 2025-08-19 15778/week @ 2025-08-26 11442/week @ 2025-09-02 17358/week @ 2025-09-09 11761/week @ 2025-09-16 11318/week @ 2025-09-23 10563/week @ 2025-09-30 10017/week @ 2025-10-07 13481/week @ 2025-10-14 13008/week @ 2025-10-21 14124/week @ 2025-10-28 14285/week @ 2025-11-04 11724/week @ 2025-11-11 8943/week @ 2025-11-18 6015/week @ 2025-11-25 4544/week @ 2025-12-02

34,160 downloads per month
Used in 43 crates (5 directly)

MIT/Apache

73KB
2K SLoC

Size Of

A crate for measuring the total memory usage of an object at runtime

Features

size-of has built-in support for many 3rd party crates that can be enabled with feature flags

  • std: Enables support for the rust standard library (enabled by default, when disabled size-of is #![no_std] compatible)
  • derive: Enables support for #[derive(SizeOf)] (enabled by default)
  • time: Enables support for the time crate
    • time-std: Enables support for time's std feature
  • chrono: Enables support for the chrono crate
  • hashbrown: Enables support for the hashbrown crate
  • fxhash: Enables support for the fxhash crate
  • rust_decimal: Enables support for the rust_decimal crate
  • ordered-float: Enables support for the ordered-float crate
  • ahash: Enables support for the ahash crate
    • ahash-std: Enables support for ahash's std feature
  • xxhash-rust: Enables support for the xxhash-rust crate
    • xxhash-xxh32: Enables support for xxhhash-rust's xxh32 feature
    • xxhash-xxh64: Enables support for xxhhash-rust's xxh64 feature
    • xxhash-xxh3: Enables support for xxhhash-rust's xxh3 feature

Dependencies

~0–1.4MB
~25K SLoC