I'm not aware of any really nice tool to do this. clang's memory
sanitizer may work (I think last time I looked the gcc equivalent was
not capable of doing leak detection). You can override the system
malloc with e.g. jemalloc which will give you more debug information
than the system malloc. Unfortunately most allocators leak detection
is done using an atexit handler and I didn't find a nice way to get Go
to run these handlers in my application. It is possible to run
jemalloc in a mode that dumps periodic heap traces to disk which you
can then diff to figure out which parts of the heap are growing.