When I profile the heap in go with pprof I get the following:
However, I'm not clear on how to interpret that visualization. In particular:
"The memory next to the arrows means _____ and the memory inside of a box means ______. So when a box has multiple arrows from it, it means _____, and when it has multiple arrows to it, it means _____".
pprof is a tool for visualization and analysis of profiling data. pprof reads a collection of profiling samples in profile. proto format and generates reports to visualize and help analyze the data. It can generate both text and graphical reports (through the use of the dot visualization package).
The normal way to use pprof seems to be: Set up a webserver for getting Go profiles (with import _ "net/http/pprof" ) Run curl localhost:$PORT/debug/pprof/$PROFILE_TYPE to save a profile. Use go tool pprof to analyze said profile.
Heap differentiates between count and count unique, where count is the total of times an event has occurred and count unique represents each individual user that completed an event. For example, if one user completed the same event four times, the count would be four, and the count unique would be one.
No difference between the meaning of the arrows between the heap and the CPU profiling mode.
You may be interested in the output of the top
pprof command, which can give you results in the following form:
9701.61kB of 9701.61kB total ( 100%) Dropped 112 nodes (cum <=
48.51kB) Showing top 10 nodes out of 29 (cum >= 3611.54kB)
flat flat% sum% cum cum%
4549.72kB 46.90% 46.90% 4549.72kB 46.90% mystery.function
2587.52kB 26.67% 73.57% 2587.52kB 26.67% reflect.unsafe_NewArray
1024.02kB 10.56% 84.12% 1024.02kB 10.56% encoding/xml.copyValue
514kB 5.30% 89.42% 514kB 5.30% compress/gzip.NewReader
514kB 5.30% 94.72% 514kB 5.30% net/http.(*Transport).dialConn
512.34kB 5.28% 100% 512.34kB 5.28% runtime.makeslice
0 0% 100% 514kB 5.30% bytes.(*Buffer).ReadFrom
0 0% 100% 3611.54kB 37.23% encoding/xml.(*Decoder).Decode
0 0% 100% 3611.54kB 37.23% encoding/xml.(*Decoder).DecodeElement
0 0% 100% 3611.54kB 37.23% encoding/xml.(*Decoder).unmarshal
And here are (IMHO) the two best references for Go heap profiling with pprof:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With