In code, follow your allocations that are around too long. Make sure you are actually releasing references to them.
One that bit me was a []byte to string conversion. The string uses the []byte as backing memory, so any slice of that string keeps the entire []byte around.
Using pprof to troubleshoot memory leaks, we've isolated some types that are surviving GC much longer than expected. The tooling is great for identifying the source of allocations, but I'm having a hard time figuring out why these are still referenced/rooted and are not being GC'd. I've implemented a mechanism to capture heap dumps via runtime/debug.WriteHeapDump(), and since we're on Go 1.4.2 I've tried using heapdump14 to analyze the dump, but sadly that's failing due to some cgo usage (issue here).Are there any other tools for analyzing 1.4 heap dumps, or other strategies for identifying what is still referencing types we wouldn't expect to stick around after a GC? We're investigating the feasibility of eliminating the cgo dependency, but I'm hoping to gain some more insight in the meantime...
--
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 golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.