#debugging #malloc #memory #glibc

malloc-info

A safe wrapper around glibc's malloc_info

3 releases

0.1.2 Jan 16, 2025
0.1.1 Jan 15, 2025
0.1.0 Jan 15, 2025

#165 in Memory management

Download history 216/week @ 2025-01-10 511/week @ 2025-01-17 271/week @ 2025-01-24 1100/week @ 2025-01-31 999/week @ 2025-02-07 635/week @ 2025-02-14 530/week @ 2025-02-21 979/week @ 2025-02-28 307/week @ 2025-03-07 572/week @ 2025-03-14 221/week @ 2025-03-21 257/week @ 2025-03-28

1,534 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.5–8.5MB
~74K SLoC