I have a compiled Go program, which sometimes occupies large amount of memory. Unfortunately, I don't have its source code, so it is impossible to modify it to add a runtime/pprof
server. I was wondering is there any way to invoke runtime.GC()
or generate a heap dump without modifying the source code?
I don't think so.
Even reacting to a signal (like SIGQUIT) would require to code it, as seen here.
With only the executable (no .a
, no sources), you would only have go tool objdump
.