285 releases (29 breaking)

Uses new Rust 2024

new 0.31.0-alpha.1 Mar 10, 2026
0.30.0 Feb 25, 2026
0.28.1 Dec 19, 2025
0.28.0-alpha.0 Nov 21, 2025
0.4.0 Mar 28, 2023

#164 in Memory management

Download history 15315/week @ 2025-11-19 7538/week @ 2025-11-26 14170/week @ 2025-12-03 24695/week @ 2025-12-10 18645/week @ 2025-12-17 6251/week @ 2025-12-24 11019/week @ 2025-12-31 25131/week @ 2026-01-07 20945/week @ 2026-01-14 23579/week @ 2026-01-21 24369/week @ 2026-01-28 24372/week @ 2026-02-04 19846/week @ 2026-02-11 18345/week @ 2026-02-18 23624/week @ 2026-02-25 26147/week @ 2026-03-04

94,112 downloads per month
Used in 103 crates (10 directly)

MIT/Apache

230KB
4K SLoC

Run-time memory tracking and profiling.

First steps

Add re_memory to your Cargo.toml:

cargo add re_memory

Install the AccountingAllocator in your main.rs:

use re_memory::AccountingAllocator;

#[global_allocator]
static GLOBAL: AccountingAllocator<std::alloc::System>
    = AccountingAllocator::new(std::alloc::System);

Checking memory use

Use MemoryUse::capture to get the current memory use of your application.

Finding memory leaks

Turn on memory tracking at the top of your main() function:

re_memory::accounting_allocator::set_tracking_callstacks(true);

Now let your app run for a while, and then call accounting_allocator::tracking_stats to get the statistics. Any memory leak should show up in TrackingStatistics::top_callstacks.

More

See also accounting_allocator.


Run-time memory tracking and profiling.

Part of the rerun family of crates.

Latest version Documentation MIT Apache

This is a library for tracking memory use in a running application. This is useful for tracking leaks, and for figuring out what is using up memory.

re_memory includes an opt-in sampling profiler for allocation callstacks. Each time memory is allocated there is a chance a callstack will be collected. This information is tracked until deallocation. You can thus get information about what callstacks lead to the most live allocations, giving you a very useful memory profile of your running app, with minimal overhead.

Dependencies

~22–56MB
~773K SLoC