
Lightweight memory profiler enabling object-graph traversal and per-object size introspection, with flame-graph generation to reveal allocation gaps, padding, and non-malloc or subset memory usage.
This is a Kotlin Multiplatform line-by-line transliteration port of facebookexperimental/allocative.
Original Project: This port is based on facebookexperimental/allocative. All design credit and project intent belong to the upstream authors; this repository is a faithful port to Kotlin Multiplatform with no behavioural changes intended.
This is an in-progress port. The goal is feature parity with the upstream Rust crate while providing a native Kotlin Multiplatform API. Every Kotlin file carries a // port-lint: source <path> header naming its upstream Rust counterpart so the AST-distance tool can track provenance.
The text below is reproduced and lightly edited from
https://github.com/facebookexperimental/allocative. It is the upstream project's own description and remains under the upstream authors' authorship; links have been rewritten to absolute upstream URLs so they continue to resolve from this repository.
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.
dependencies {
implementation("io.github.kotlinmania:allocative-kotlin:0.1.2")
}./gradlew build
./gradlew testSee AGENTS.md and CLAUDE.md for translator discipline, port-lint header convention, and Rust → Kotlin idiom mapping.
This Kotlin port is distributed under the same MIT license as the upstream facebookexperimental/allocative. See LICENSE (and any sibling LICENSE-* / NOTICE files mirrored from upstream) for the full text.
Original work copyrighted by the allocative authors.
Kotlin port: Copyright (c) 2026 Sydney Renee and The Solace Project.
Thanks to the facebookexperimental/allocative maintainers and contributors for the original Rust implementation. This port reproduces their work in Kotlin Multiplatform; bug reports about upstream design or behavior should go to the upstream repository.
This is a Kotlin Multiplatform line-by-line transliteration port of facebookexperimental/allocative.
Original Project: This port is based on facebookexperimental/allocative. All design credit and project intent belong to the upstream authors; this repository is a faithful port to Kotlin Multiplatform with no behavioural changes intended.
This is an in-progress port. The goal is feature parity with the upstream Rust crate while providing a native Kotlin Multiplatform API. Every Kotlin file carries a // port-lint: source <path> header naming its upstream Rust counterpart so the AST-distance tool can track provenance.
The text below is reproduced and lightly edited from
https://github.com/facebookexperimental/allocative. It is the upstream project's own description and remains under the upstream authors' authorship; links have been rewritten to absolute upstream URLs so they continue to resolve from this repository.
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.
dependencies {
implementation("io.github.kotlinmania:allocative-kotlin:0.1.2")
}./gradlew build
./gradlew testSee AGENTS.md and CLAUDE.md for translator discipline, port-lint header convention, and Rust → Kotlin idiom mapping.
This Kotlin port is distributed under the same MIT license as the upstream facebookexperimental/allocative. See LICENSE (and any sibling LICENSE-* / NOTICE files mirrored from upstream) for the full text.
Original work copyrighted by the allocative authors.
Kotlin port: Copyright (c) 2026 Sydney Renee and The Solace Project.
Thanks to the facebookexperimental/allocative maintainers and contributors for the original Rust implementation. This port reproduces their work in Kotlin Multiplatform; bug reports about upstream design or behavior should go to the upstream repository.