Dumping heap of Go process at runtime

1.5k Views Asked by At

We have a go process in production using Gigabytes more memory than usual. It's suffered from an unusual memory leak. We stopped input to this process to allow the GC to settle. It is still running with a RES of multiple Gigabytes. Is there a way to attach to this process and dump heap in a way that can be analyzed using hprof visualization tools?

1

There are 1 best solutions below

1
On

for now, you can use runtime package to write heap profile to a file, and analyze it with gpreftools visualization tool.