randall77 / hprof

Heap profile reader for Go
The Unlicense
85 stars 7 forks source link

Support go heapdumps from 1.7+ #6

Open jbarciauskas opened 6 years ago

jbarciauskas commented 6 years ago

Update the reader to support the newest heapdump format, based on https://github.com/golang/go/wiki/heapdump15-through-heapdump17

Trying to figure out how to get the type information of objects.

jbarciauskas commented 6 years ago

Thanks for the feedback. I found the same thing digging through history re: type info. I definitely opened this prematurely. It did happen to parse everything so I just wanted to get it up.

I can go back and make this support multiple formats, though without the type information I don't know how useful 1.5+ heapdumps are, either to me or anyone else.

randall77 commented 6 years ago

Yes, since 1.4 there just isn't enough type info recorded by the runtime during allocation. The heap dump contents reflect that.

We're moving to a new model where functionality like this is provided by standard core dumps. There we have DWARF information so we can do a better job reconstructing types. You might want to check out the new tool and libraries: golang.org/x/debug/core golang.org/x/debug/gocore golang.org/x/debug/cmd/viewcore

jbarciauskas commented 6 years ago

@randall77 following up on this, viewcore looks great, but where can I give feedback/ask qs?

randall77 commented 6 years ago

The standard Go issue tracker can be used to report issues. For just discussion (questions, etc.) you can use the golang-nuts mailing list. Or mail me directly. See https://golang.org/project/ for details.

ptabor commented 3 years ago

@randall77 I think we a lot of people find this thread looking for an alternative to:

debug.WriteHeapDump(f.Fd())

that allows to dump the heap without stopping the process to inspect it later using viewcore. Could you, please, point into the right direction ?