Registry / utility / jemalloc-ctl

jemalloc-ctl

JSON →
library0.5.4rscratesunverified

A safe wrapper over jemalloc's control and introspection APIs for runtime memory management.

# Cargo.toml [dependencies] jemalloc-ctl = "0.5.4"
INSTALL
IMPORT
SIG · JEMALLOC-CTL
J
jemalloc-ctl
utilityrustv0.5.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

allocated
use jemalloc_ctl::stats::allocated;

Reads the total allocated memory from jemalloc.

use jemalloc_ctl::stats::allocated; fn main() { let allocated = allocated::read().unwrap(); println!("Allocated bytes: {}", allocated); }
Debug
Known issues
gotchaRequires jemalloc as the global allocator; otherwise, reads may be invalid.
fix
Set jemalloc as global allocator with `#[global_allocator] static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;`
affects: >=0.5.0
Upgrade
Version history
0.5.4latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
19 hits · last 30 days
node
16
OpenAI (training)
2
Resources
jemalloc-ctl — cargo add jemalloc-ctl · libregistry