This is a creation in Article, where the information may have evolved or changed. [Root@s3 twitter]# Go tool pprof http://localhost:6060/debug/pprof/heap--text
Read Http://localhost:6060/debug/pprof/symbol
Fetching/pprof/heap profile from localhost:6060 to
/tmp/76z7mntrzo
Wrote profile To/tmp/76z7mntrzo
Adjusting heap profiles for 1-in-524288 sampling rate
total:47.5 MB
24.5 51.6% 51.6% 24.5 51.6% Reflect.unsafe_newarray
23.0 48.4% 100.0% 23.0 48.4% database/sql.convertassign
0.0 0.0% 100.0% 23.0 48.4% database/sql. (*rows). Scan
0.0 0.0% 100.0% 47.5 100.0% Github.com/coopernurse/gorp. (*dbmap). Select
0.0 0.0% 100.0% 47.5 100.0% github.com/coopernurse/gorp.hookedselect
0.0 0.0% 100.0% 47.5 100.0% github.com/coopernurse/gorp.rawselect
0.0 0.0% 100.0% 47.5 100.0% main.gettwitternoparse
0.0 0.0% 100.0% 27.5 57.9% Main.main
0.0 0.0% 100.0% 47.5 100.0% main.parsehtml
0.0 0.0% 100.0% 24.5 51.6% reflect. Append
0.0 0.0% 100.0% 24.5 51.6% reflect. Makeslice
0.0 0.0% 100.0% 24.5 51.6% Reflect.grow
0.0 0.0% 100.0% 1.4 2.9% Runtime. Mprof_malloc
0.0 0.0% 100.0% 1.4 2.9% runtime.callers
0.0 0.0% 100.0% 25.1 52.8% runtime.gosched0
0.0 0.0% 100.0% 26.8 56.4% Runtime.main
[Root@s3 twitter]# Go tool pprof http://localhost:6060/debug/pprof/heap--text
Read Http://localhost:6060/debug/pprof/symbol
Fetching/pprof/heap profile from localhost:6060 to
/tmp/6rfif3xdyb
Wrote profile To/tmp/6rfif3xdyb
Adjusting heap profiles for 1-in-524288 sampling rate
total:57.1 MB
30.1 52.7% 52.7% 30.1 52.7% Reflect.unsafe_newarray
27.0 47.3% 100.0% 27.0 47.3% database/sql.convertassign
0.0 0.0% 100.0% 27.0 47.3% database/sql. (*rows). Scan
0.0 0.0% 100.0% 57.1 100.0% Github.com/coopernurse/gorp. (*dbmap). Select
0.0 0.0% 100.0% 57.1 100.0% github.com/coopernurse/gorp.hookedselect
0.0 0.0% 100.0% 57.1 100.0% github.com/coopernurse/gorp.rawselect
0.0 0.0% 100.0% 57.1 100.0% main.gettwitternoparse
0.0 0.0% 100.0% 27.5 48.2% Main.main
0.0 0.0% 100.0% 57.1 100.0% main.parsehtml
0.0 0.0% 100.0% 30.1 52.7% reflect. Append
0.0 0.0% 100.0% 30.1 52.7% reflect. Makeslice
0.0 0.0% 100.0% 30.1 52.7% reflect.grow
0.0 0.0% 100.0% 1.4 2.5% Runtime. Mprof_malloc
0.0 0.0% 100.0% 1.4 2.5% runtime.callers
0.0 0.0% 100.0% 25.1 44.0% runtime.gosched0
0.0 0.0% 100.0% 26.8 46.9% Runtime.main
Memory consumption is increasing!
(pprof) Top
total:94.1 MB
49.6 52.7% 52.7% 49.6 52.7% Reflect.unsafe_newarray
44.5 47.3% 100.0% 44.5 47.3% database/sql.convertassign
0.0 0.0% 100.0% 44.5 47.3% database/sql. (*rows). Scan
Generate SVG, you have to install Graphviz, the browser opens SVG, the diagram is very clear.
Yum Install graphviz-y
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.