golang pprof
1. add pprof in golang program
https://pkg.go.dev/runtime/pprof
2. collect pprof data
Use the pprof tool to look at the heap profile:
curl http://localhost:6060/debug/pprof/heap --output heap.txt
Or to look at a 30-second CPU profile:
curl http://localhost:6060/debug/pprof/profile?seconds=30 --output profile.txt