我尝试使用pprof来分析我的程序,而我正在使用
import _ net/http/pprof to add /debug/pprof endpoints in my service.
在浏览器中访问:
http://ip:port/debug/pprof/
然后我将显示以下页面:
当我点击链接时:http://ip:port/debug/pprof/heap?debug=1
我将看到以下内容:
这里的4个数字:
2508: 273338776 [4733405: 12257136096]
是指inuse_objects:inuse_space [all_objects:alloc_space],对吗?
“堆数”与inuse_objects
有任何关系吗?
答案 0 :(得分:0)
检查the template for the index page显示该计数是由pprof.Profile.Count产生的:
Count返回配置文件中当前的执行堆栈数。
换句话说,索引页面显示了到目前为止每种类型的概要文件已收集的样本数量。它们与任何特定指标(例如inuse_objects或inuse_space)都不相关。