I am coming from Golang background, and pprof works out of box for CPU and memory with pprof package - net/http/pprof - Go Packages. Nice and easy.
When I work on Rust, I find CPU profile works similarly to Go. But for memory, it is not out of box. I used GitHub - polarsignals/rust-jemalloc-pprof: Convert jemalloc heap profiles to pprof to understand memory usage, fix memory leaks, and fix OOM Kills. for memory profile.
The way I used profile is:
- setup some web handlers, so profile is triggered when receiving a request like
/debug/pprofile/heap
(for memory profile) or/debug/pprofile/cpu
(for cpu profile) - call the curl remotely from my local machine
- use
pprof
to analyze the profile dump on my local machine.
I find it works for Golang cpu/heap and Rust cpu profile. But for memory, I am seeing Local symbolization failed for xxxxx-a2099af8e65d354b (build ID c04fcdbe120999b2): stat /tmp/xxxxx-a2099af8e65d354b
. I can get around it by setting PPROF_BINARY_PATH
and download xxxxx-a2099af8e65d354b
to my local host.
But I do not understand why I only need to do this for Rust jemalloc memory profile?