277 releases (28 breaking)

Uses new Rust 2024

new 0.30.0-alpha.3 Feb 12, 2026
0.29.2 Feb 12, 2026
0.28.1 Dec 19, 2025
0.28.0-alpha.0 Nov 21, 2025
0.4.0 Mar 28, 2023

#176 in Memory management

Download history 10260/week @ 2025-10-27 10262/week @ 2025-11-03 12787/week @ 2025-11-10 15951/week @ 2025-11-17 6790/week @ 2025-11-24 12388/week @ 2025-12-01 22045/week @ 2025-12-08 20746/week @ 2025-12-15 10561/week @ 2025-12-22 4150/week @ 2025-12-29 26995/week @ 2026-01-05 21872/week @ 2026-01-12 21659/week @ 2026-01-19 23354/week @ 2026-01-26 23653/week @ 2026-02-02 24236/week @ 2026-02-09

93,714 downloads per month
Used in 103 crates (10 directly)

MIT/Apache

155KB
2.5K 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

~7–39MB
~460K SLoC