Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Go(lang): How to use PPROF heap profile to find memory leaks?

I am trying to use pprof to verify memory leaks.

Can any explain how to read the heap profile that you find at: http://localhost:6060/debug/pprof/heap?debug=1

Also, is it normal that by typing the web command after starting go tool pprof http://localhost:6060/debug/pprof/heap it produces an empty .svg file?

Many Thanks

like image 225
Daniele B Avatar asked Sep 29 '13 17:09

Daniele B


1 Answers

I may help with the second question. You must provide the name of the binary to your command:

go tool pprof YOUR_COMPILED_BINARY http://localhost:6060/debug/pprof/heap
like image 132
alpe1 Avatar answered Sep 25 '22 21:09

alpe1