Have you tried just running a separate `ListenAndServe` on another port on
localhost, such as "localhost:6060"?

That is what's done in the documentation and I've copied that with success
many times.

    // should do the trick
    go http.ListenAndServe("localhost:6060", nil)

Then (from within the server) you should be able to hit:

http://localhost:6060/debug/pprof/heap
http://localhost:6060/debug/pprof/profile
http://localhost:6060/debug/pprof/goroutine?debug=2
http://localhost:6060/debug/pprof/goroutine?debug=1

If you wget or curl the first two, you can download them to your local
machine and use them with the go tool to view the nice images and see
things like allocations by lines of code:

go tool pprof binaryname filename.pprof

Commands I've found most useful:

web
top 10
list <function name>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to