nnethercote / dhat-rs

Heap profiling and ad hoc profiling for Rust programs.
Apache License 2.0
744 stars 36 forks source link

Not work for `rustc_driver` #35

Open Jaic1 opened 5 months ago

Jaic1 commented 5 months ago

The dhat::Profiler profiler gives zero heap stats (i.e., not allocating any blocks) when I use the rustc_driver crate to start a rustc instance. After debugging, I find that dhat::Alloc::alloc does not get called.

@nnethercote I wonder if this problem is relevant to the fact that rustc has a special mechanism to use jemalloc. BTW, valgrind --tool=dhat works for my project (already helped resolving OOM problems but took dozens of hours to run), and I guess dhat-rs would run significantly faster.