Skip to content

Instantly share code, notes, and snippets.

@brson
Created April 15, 2016 21:37
Show Gist options
  • Save brson/68d3da35b7c6100e76d43bc4538e20cb to your computer and use it in GitHub Desktop.
Save brson/68d3da35b7c6100e76d43bc4538e20cb to your computer and use it in GitHub Desktop.
Rust heap profiling with jemalloc

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.

Here's a page with some ideas.

@hicqu
Copy link

hicqu commented Apr 1, 2021

I have tested it and it really works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment