Heap and Allocation Profiling
Finding memory hotspots with heap profiles
Why heap profiling?
Excessive memory allocations slow Go programs through GC pressure. Heap profiling shows which code paths allocate the most memory so you can reduce allocations.
Capturing a heap profile
Via HTTP endpoint (requires net/http/pprof):
go tool pprof http://localhost:6060/debug/pprof/heapAll lessons in this course
- Writing Benchmarks with testing.B
- CPU Profiling with pprof
- Heap and Allocation Profiling
- Execution Tracing