gpt4 book ai didi

golang pprof堆计数含义

转载 作者:数据小太阳 更新时间:2023-10-29 03:19:47 26 4
gpt4 key购买 nike

描述

我尝试使用 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 有什么关系吗?

最佳答案

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

Count returns the number of execution stacks currently in the profile.

换句话说,索引页显示了到目前为止为每种类型的配置文件收集的样本数。它们与任何特定指标无关,例如 inuse_objects 或 inuse_space。

关于golang pprof堆计数含义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55825508/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com