I've never done this but I've heard it works.
Configure the Rust build like make JEMALLOC_FLAGS=--enable-prof
. You might also want --enable-prof-libunwind
.
Then run your program with something lke MALLOC_CONF=prof:true
and it should dump stats to files called "jeprof*.out". Then you use the jeprof tool, which I am not sure how to get, to interpret it.