简体   繁体   中英

Run pprof on data collected from remote machine?

I have a program that runs on a remote headless machine (ie no X server) that has a memory leak. I was able to install gperftools and ran the heap checker which found the leak.

My problem is I can't install pprof on the remote machine because of all the graphics libraries required so I copied the generated.heap file onto a different machine that does have pprof installed. This machine also has all the same libraries as the rmote machine.

I tried running the pprof command suggested by the heap checker, but with --text instead of --gv

$ pprof <my_bin> <heap_file> --inuse_objects --lines --heapcheck --text

but it complains about a failed curl command

Using local file <my_bin>.    
Use of uninitialized value $host in substitution (s///) at
/usr/bin/pprof line 3195. Use of uninitialized value $hostport in
concatenation (.) or string at /usr/bin/pprof line 3197. Use of
uninitialized value $prefix in concatenation (.) or string at
/usr/bin/pprof line 3197. Use of uninitialized value $host in
substitution (s///) at /usr/bin/pprof line 3195. Use of uninitialized
value $hostport in concatenation (.) or string at /usr/bin/pprof line
3197. Use of uninitialized value $prefix in concatenation (.) or string at /usr/bin/pprof line 3197. Use of uninitialized value $host
in sprintf at /usr/bin/pprof line 3364. Gathering CPU profile from
http:///pprof/profile?seconds=30 for 30 seconds to  
/home/developer/pprof/<my_bin>.1640195244. Be patient...
curl: (6) Couldn't resolve host 'http' Failed to get profile: curl
'http:///pprof/profile?seconds=30' >
/home/developer/pprof/.tmp.<my_bin>.1640195244.: No such
file or directory

So my questions are: is what I am attempting even possible? is there a different pprof command I should be using? what is the curl command about?

Thanks,

Simply use go version of pprof. In this case I suspect what happens is that arg parsing doesn't really support flags at the end (I suspect go's has this bug as well). This use case of pprofing with binary and pprof file is definitely supported.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM