Registry / observability / dhat
library0.3.3rscratesunverified

A heap profiling and ad hoc profiling tool for Rust programs, based on DHAT from Valgrind.

# Cargo.toml [dependencies] dhat = "0.3.3"
INSTALL
IMPORT
SIG · DHAT
D
dhat
observabilityrustv0.3.3
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.

HeapStats
use dhat::HeapStats;

Initialize a heap profiler and print current heap usage.

use dhat::{HeapStats, Profiler}; let _profiler = Profiler::new_heap(); let _stats = HeapStats::get(); println!("Current heap bytes: {}", _stats.curr_bytes);
Debug
Known issues
gotchaProfiler must be kept alive for the entire profiling session; dropping it early stops profiling.
fix
Bind the Profiler to a variable with a long enough lifetime (e.g., at the start of main).
affects: >=0.3.0
Upgrade
Version history
0.3.3latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
25 hits · last 30 days
node
22
OpenAI (training)
2
Resources
dhat — cargo add dhat · libregistry