简体   繁体   English

对从远程机器收集的数据运行 pprof?

[英]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.我有一个在远程无头机器(即没有 X 服务器)上运行的程序,它有 memory 泄漏。 I was able to install gperftools and ran the heap checker which found the leak.我能够安装 gperftools 并运行发现泄漏的堆检查器。

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.我的问题是由于需要所有图形库,我无法在远程机器上安装 pprof,因此我将 generate.heap 文件复制到另一台安装了 pprof 的机器上。 This machine also has all the same libraries as the rmote machine.这台机器也有与 rmote 机器相同的库。

I tried running the pprof command suggested by the heap checker, but with --text instead of --gv我尝试运行堆检查器建议的 pprof 命令,但使用 --text 而不是 --gv

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

but it complains about a failed curl command但它抱怨 curl 命令失败

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?我应该使用不同的 pprof 命令吗? what is the curl command about? curl 命令是关于什么的?

Thanks,谢谢,

Simply use go version of pprof.只需使用 pprof 的 go 版本。 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).在这种情况下,我怀疑会发生什么是 arg 解析最后并不真正支持标志(我怀疑 go 也有这个错误)。 This use case of pprofing with binary and pprof file is definitely supported.绝对支持这种使用二进制和 pprof 文件进行 pprofing 的用例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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