{"id":58542,"library":"dhat","title":"dhat","description":"A heap profiling and ad hoc profiling tool for Rust programs, based on DHAT from Valgrind.","status":"active","version":"0.3.3","language":"rust","source_language":null,"source_url":"https://github.com/nnethercote/dhat-rs","tags":["profiling","heap","debugging","performance"],"install":[{"cmd":"# Cargo.toml\n[dependencies]\ndhat = \"0.3.3\"","lang":"toml","label":"Cargo.toml"},{"cmd":"cargo add dhat","lang":"bash","label":"cargo add"}],"dependencies":[],"imports":[{"symbol":"HeapStats","correct":"use dhat::HeapStats;"}],"quickstart":{"code":"use dhat::{HeapStats, Profiler};\n\nlet _profiler = Profiler::new_heap();\nlet _stats = HeapStats::get();\nprintln!(\"Current heap bytes: {}\", _stats.curr_bytes);","lang":"rust","description":"Initialize a heap profiler and print current heap usage."},"warnings":[{"fix":"Bind the Profiler to a variable with a long enough lifetime (e.g., at the start of main).","message":"Profiler must be kept alive for the entire profiling session; dropping it early stops profiling.","severity":"gotcha","affected_versions":">=0.3.0"}],"env_vars":null,"search_vec":"'ad':6 'base':13 'debug':20 'dhat':1,15 'heap':3,19 'hoc':7 'perform':21 'profil':4,8,18 'program':12 'rust':11 'tool':9 'valgrind':17","created_at":"2026-06-16T16:27:52.036162+00:00","updated_at":"2026-06-16T16:27:52.036162+00:00","problems":[],"ecosystem":"crates","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/nnethercote/dhat-rs","github":"https://github.com/nnethercote/dhat-rs","docs":"https://docs.rs/dhat/","changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["observability","utility"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-16","next_check":"2026-12-13","install_tag":null}}