#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

#330 in Memory management

Download history 153/week @ 2025-10-20 77/week @ 2025-10-27 82/week @ 2025-11-03 52/week @ 2025-11-10 98/week @ 2025-11-17 87/week @ 2025-11-24 145/week @ 2025-12-01 89/week @ 2025-12-08 93/week @ 2025-12-15 52/week @ 2025-12-22 33/week @ 2025-12-29 65/week @ 2026-01-05 146/week @ 2026-01-12 61/week @ 2026-01-19 68/week @ 2026-01-26 46/week @ 2026-02-02

322 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–4.5MB
~78K SLoC