#glibc #malloc #debugging #memory-debugging #memory

malloc-info

A safe wrapper around glibc's malloc_info

4 releases

0.1.3 Nov 24, 2025
0.1.2 Jan 16, 2025
0.1.1 Jan 15, 2025
0.1.0 Jan 15, 2025

#264 in Memory management

Download history 92/week @ 2026-01-06 101/week @ 2026-01-13 67/week @ 2026-01-20 63/week @ 2026-01-27 93/week @ 2026-02-03 113/week @ 2026-02-10 617/week @ 2026-02-17 369/week @ 2026-02-24 1006/week @ 2026-03-03 3099/week @ 2026-03-10 4239/week @ 2026-03-17 2724/week @ 2026-03-24 2295/week @ 2026-03-31 1500/week @ 2026-04-07 3996/week @ 2026-04-14 2213/week @ 2026-04-21

10,519 downloads per month

MIT/Apache

15KB
313 lines

This crate provides safe access to glibc's malloc_info function. See the malloc_info(3) page for details on that function.

Example

let info = malloc_info().expect("malloc_info");
println!("{:#?}", info);

Caveats

malloc_info is a glibc-specific function and is not available on all platforms. This crate will not work on platforms where malloc_info is not available.

malloc_info will only report heap statistics for the glibc heap. If your program uses a different heap implementation, for example by #[global_allocator] or by using a different libc, malloc_info will not report statistics for that heap.


malloc-info

This is a simple library to wrap glibc's malloc_info function in a safe, Rust interface.

License

malloc-info is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0).

See LICENSE-APACHE, LICENSE-MIT for details.

Copyright (c) 2025 Zetier

Dependencies

~1.6–4MB
~72K SLoC