Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
doc: runtime/pprof documentation needs clarification #29444
The documentation is not clear regarding what exactly pprof shows. Here are a few examples.
Let's open the flamegraph. There are at least two possibilities:
Since I/O can be quite slow these are very different options. Both reports are useful depending on what bottleneck we are trying to fix (I/O or CPU).
I'm assuming the flamegraph shows places where given amount of memory was allocated. However it's not clear whether this is 1) the total amount of allocated memory (i.e. it doesn't matter if it was freed), 2) amount of allocated memory of objects that are currently alive, or 3) amount of memory of objects that are not garbage collected yet. Without proper documentation there is no way to tell which option, if any, is correct.
The time shown doesn't make much sense. On the flamegraph I see something like
For memory, see the documentation in https://golang.org/pkg/runtime/pprof/#Profile
pprof still offers -inuse_space, -inuse_objects, -alloc_space, and -alloc_objects flags for Go's memory profiles.
CPU profile is SIGPROF-based measurement (see man setitimer, ITIMER_PROF) of active CPU cycles.