cloudwego/goref
Acerca de
Herramienta para analizar las referencias a objetos del montón de Go.
Herramientas de desarrolloCrecimiento de estrellas medido
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- +1
- in 1 month
- Recopilando historial
Cambios netos en períodos que se solapan, no totales diarios. Los datos no disponibles se dejan en blanco. Las estrellas indican interés, no calidad.
README.md
OriginalGoref
English | 中文
Goref is a Go heap object reference analysis tool based on delve.
It can display the space and object count distribution of Go memory references, which is helpful for efficiently locating memory leak issues or viewing persistent heap objects to optimize the garbage collector (GC) overhead.
Installation
$ go install github.com/cloudwego/goref/cmd/grf@latest
Usage
Attach to a running process with its PID, and then use go pprof tool to open the output file.
$ grf attach ${PID}
successfully output to `grf.out`
$ go tool pprof -http=:5079 ./grf.out
Please be aware that
grf attachwill suspend the program until the command exits.
The opened HTML page displays the reference distribution of the heap memory. You can choose to view the "inuse space" or "inuse objects".
For example, the heap profile sampled from a testing program is shown below, which reflects the call stack distribution of object creation.
By using the goref tool, you can see the memory reference distribution of heap objects reachable by GC, thereby quickly pinpointing the actual code locations holding references.
It also supports analyzing core files, e.g.
$ grf core ${execfile} ${corefile}
successfully output to `grf.out`
Go Version Constraints
- Executable file: go1.19 ~ go1.26
- Compile goref tool: >= go1.21
Docs
Credit
Thanks to Delve for providing powerful golang debugger.
Explorar proyectos relacionados
Cargando…