英文:
Can I download a heap dump to run pprof on later?
问题
我正在尝试找到一种方法来存储pprof的堆数据,以便我可以共享它、稍后查看它、附加到问题等等。到目前为止,我的尝试都没有成功。
如果我运行
go tool pprof http://my-server/debug/pprof/heap
然后运行 web
,我会得到一个完整的图形,就像我期望的那样。然而,如果我下载文件:
wget -O heapDump http://my-server/debug/pprof/heap
然后尝试 go tool pprof heapDump
,它似乎无法完成所有需要的操作。我只得到一个非常有限的图形:
我尝试添加 ?debug=1
并尝试不同的值,但它们似乎都不能正常工作。
英文:
I'm trying to find a way to store the heap data from pprof so that I can share it, view it later, attach to issues and so on. My attempts so far have not worked.
If I run
go tool pprof http://my-server/debug/pprof/heap
and then run web
, I get a full graph like I expect. However, If I dowload the file:
wget -O heapDump http://my-server/debug/pprof/heap
and try go tool pprof heapDump
, it seems it can't do everything it needs to. I only get a very limited graph:
I have tried adding ?debug=1
and playing with different values, but none of them seem to work properly.
答案1
得分: 1
go tool pprof -png http://my-server/debug/pprof/heap > out.png
命令会将一个合适的图形保存在 out.png
文件中。
英文:
go tool pprof -png http://my-server/debug/pprof/heap > out.png
stores a proper graph for me in the out.png
file.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论