0PricingLogin
Go Academy · Lesson

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/heap

All lessons in this course

  1. Writing Benchmarks with testing.B
  2. CPU Profiling with pprof
  3. Heap and Allocation Profiling
  4. Execution Tracing
← Back to Go Academy