⚠ This repository is archived. The implementation is now hosted in the pickles repository.
Pickle for GNU poke 2.0 or later to read heap-dumps for Go programs.
Copy the go-heapdump.pk
file to ~/.local/share/poke
.
$ mkdir -p ~/.local/share/poke
$ wget -O ~/.local/share/poke/go-heapdump.pk https://github.com/ayosec/go-heapdump.pk/raw/main/go-heapdump.pk
To load this pickle use load "go-heapdump.pk"
expression:
$ poke
(poke) load "go-heapdump.pk"
If the module can't be loaded, ensure that ~/.local/share/poke
is in the
value of load_path
.
All types and variables have the GHD_
prefix. To see available types you can
use the .info
command:
(poke) .info types GHD
First, you need to create a heap-dump in the Go program:
package main
import (
"os"
"runtime/debug"
)
func main() {
if f, err := os.Create("heap-dump"); err == nil {
debug.WriteHeapDump(f.Fd())
f.Close()
}
}
Then, the file heap-dump
can be parsed with the pickle in this repository:
$ poke ./heap-dump
(poke) load "go-heapdump.pk"
(poke) GHD_File @ 0#B