我有一个程序,运行在一个远程无头机器(即无X服务器),有一个内存泄漏。我安装了gperftools并运行了堆检查器,发现了漏洞。
我的问题是,由于所需的所有图形库,我无法在远程计算机上安装pprof,所以我将生成的.heap文件复制到安装了pprof的另一台计算机上。这台机器还拥有与rmote机器相同的库。
我尝试运行堆检查器建议的pprof命令,但是使用了-text而不是-gv。
$ pprof <my_bin> <heap_file> --inuse_objects --lines --heapcheck --text但是它抱怨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所以我的问题是:我所尝试的是可能的吗?我应该使用不同的pprof命令吗?卷发命令是关于什么的?
谢谢,
发布于 2021-12-25 01:51:31
只需使用pprof的go版本即可。在这种情况下,我怀疑arg解析在结束时并不真正支持标志(我怀疑go也有这个bug )。这种使用二进制文件和pprof文件进行配置的用例是绝对支持的。
https://stackoverflow.com/questions/70453198
复制相似问题