golang pprof堆计数的含义

时间:2019-04-24 08:23:33

标签: go pprof

说明

我尝试使用pprof来分析我的程序,而我正在使用

import _ net/http/pprof to add /debug/pprof endpoints in my service.

在浏览器中访问:

http://ip:port/debug/pprof/

然后我将显示以下页面:

debug-pprof-heap

每次我尝试刷新此页面时,框中的数字都会不断增加!!

当我点击链接时:http://ip:port/debug/pprof/heap?debug=1

我将看到以下内容:

debug-pprof-heap-detail

这里的4个数字:

2508: 273338776 [4733405: 12257136096]

是指inuse_objects:inuse_space [all_objects:alloc_space],对吗?

问题

框中的这两个数字到底是什么意思?

“堆数”与inuse_objects有任何关系吗?

1 个答案:

答案 0 :(得分:0)

检查the template for the index page显示该计数是由pprof.Profile.Count产生的:

  

Count返回配置文件中当前的执行堆栈数。

换句话说,索引页面显示了到目前为止每种类型的概要文件已收集的样本数量。它们与任何特定指标(例如inuse_objects或inuse_space)都不相关。