Difference between revisions of "Go tool pprof"
Jump to navigation
Jump to search
Line 2: | Line 2: | ||
* Get stack trace: <code>[[kill -SIGUSR1]] <pid></code>, get trace and stop: [[kill -6]] <pid> | * Get stack trace: <code>[[kill -SIGUSR1]] <pid></code>, get trace and stop: [[kill -6]] <pid> | ||
− | * Get [[CPU profiling]]: add [[--pprof]] flag run <code>[[go tool pprof]] -png http://127.0.0.1:6060/debug/pprof/profile\?seconds\=20 > cpu.png</code> | + | * Get [[CPU profiling]]: add <code>[[--pprof]]</code> flag run <code>[[go tool pprof]] -png http://127.0.0.1:6060/debug/pprof/profile\?seconds\=20 > cpu.png</code> |
− | * Get [[RAM profiling]]: add --pprof flag run <code>go tool pprof -inuse_space -png http://127.0.0.1:6060/debug/pprof/heap > mem.png</code> | + | * Get [[RAM profiling]]: add <code>--pprof</code> flag run <code>go tool pprof -inuse_space -png http://127.0.0.1:6060/debug/pprof/heap > mem.png</code> |
== Related == | == Related == |
Revision as of 09:08, 8 August 2024
- Get stack trace:
kill -SIGUSR1 <pid>
, get trace and stop: kill -6 <pid> - Get CPU profiling: add
--pprof
flag rungo tool pprof -png http://127.0.0.1:6060/debug/pprof/profile\?seconds\=20 > cpu.png
- Get RAM profiling: add
--pprof
flag rungo tool pprof -inuse_space -png http://127.0.0.1:6060/debug/pprof/heap > mem.png
Related
See also
pprof, geth --pprof
- Profiling,
pprof
, Grafana Phlare - go tool, pprof
Advertising: