Library and proc macro to analyze memory usage of data structures in rust.
Rust
220
160 commits
updated Jun 14, 2026
[!IMPORTANT] June 2026: This repository is being retired and maintenance of this library is moving to https://github.com/facebook/buck2. We continue to welcome issues or PRs there.
This crate implements a lightweight memory profiler which allows object traversal and memory size introspection.
Allocative trait (typically implemented with proc-macro) is introspectable:
Allocative values can be traversed and their size and sizes of referenced
objects can be collected.
This crate provides a few utilities to work with such objects, the main of such utilities is flame graph builder which produces flame graph (see the crate documentation) like this:

Allocative is not a substitute for call stack malloc profiler, it provides a different view of memory usage.
Here are some differences between allocative and call-stack malloc profiler:
Allocative trait for each type which
needs to be measured, and some setup in the program to enable it is neededWhen allocative is used, binary size is slightly increased due to
implementations of [Allocative] trait, but it has no runtime/memory overhead
when it is enabled but not used.
Note there are several copies of this project on GitHub due to how Meta monorepo is synchronized to GitHub. The main copy is facebookexperimental/allocative.
Allocative is both MIT and Apache License, Version 2.0 licensed, as found in the LICENSE-MIT and LICENSE-APACHE files.
636 followers · starred May 2023
2,223 followers · starred Feb 2023
481 followers · starred Apr 2023
75 followers · starred May 2026
Library and proc macro to analyze memory usage of data structures in rust.
Rust
220
160 commits
updated Jun 14, 2026
[!IMPORTANT] June 2026: This repository is being retired and maintenance of this library is moving to https://github.com/facebook/buck2. We continue to welcome issues or PRs there.
This crate implements a lightweight memory profiler which allows object traversal and memory size introspection.
Allocative trait (typically implemented with proc-macro) is introspectable:
Allocative values can be traversed and their size and sizes of referenced
objects can be collected.
This crate provides a few utilities to work with such objects, the main of such utilities is flame graph builder which produces flame graph (see the crate documentation) like this:

Allocative is not a substitute for call stack malloc profiler, it provides a different view of memory usage.
Here are some differences between allocative and call-stack malloc profiler:
Allocative trait for each type which
needs to be measured, and some setup in the program to enable it is neededWhen allocative is used, binary size is slightly increased due to
implementations of [Allocative] trait, but it has no runtime/memory overhead
when it is enabled but not used.
Note there are several copies of this project on GitHub due to how Meta monorepo is synchronized to GitHub. The main copy is facebookexperimental/allocative.
Allocative is both MIT and Apache License, Version 2.0 licensed, as found in the LICENSE-MIT and LICENSE-APACHE files.
636 followers · starred May 2023
2,223 followers · starred Feb 2023
481 followers · starred Apr 2023
75 followers · starred May 2026