gopprof

golang pprof heap count meaning


Description

I try to use pprof to profile my programme, and i am using

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

access in browser:

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

then i will have the following page:

debug-pprof-heap

Everytime when i try to refresh this page, the number in the boxes keep increase!!

When i follow the link: http://ip:port/debug/pprof/heap?debug=1

i will see the following:

debug-pprof-heap-detail

the 4 numbers here :

2508: 273338776 [4733405: 12257136096]

means inuse_objects: inuse_space [all_objects: alloc_space], am i right?

Question

What do this two numbers in boxes actually mean?

Does the "heap count" has any relation with the inuse_objects ?


Solution

  • Inspecting the template for the index page shows that the count is produced by pprof.Profile.Count:

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

    In other words, the index page shows the number of samples that have been collected for each type of profile so far. They are not related to any particular metric, such as inuse_objects or inuse_space.