Golang's Garbage
summary
Uber measures Go nodes spending ~75% of runtime in background GC on a ~96GB heap; perf top and flamegraphs plus go debug gctrace reveal long background mark/sweep and assist CPU (minutes across cores) while stop-the-world pauses stay small. Remedies: reduce pointers with pointerless maps/channels and uintptr indirection, prefer sync.Pool quirks, or bypass the GC with a native heap via mmap and ninja slices (reflect+unsafe). Implementing that native heap drops P99 latency ~4x (≈2s to ≈0.5s) but requires manual memory management.
AI-written summary · about
chapters (11)
- 0:00Intro
- 0:43Claim of Credibility
- 5:40Modern GC
- 9:03Golang GC
- 14:15GODEBUG=gctrace=1
- 20:17Heap Bitmap
- 24:26Easy Tricks
- 28:05Pooling
- 34:01Native Heap
- 39:06Native Slices
- 44:38What's Next?
related talks
30mMemory Management in Go: The good, the bad and the ugly
50mAn insight into Go Garbage Collection
19mHeap Optimization for Go Systems
36mGolang's Realtime GC in Theory and Practice
26mRespecting Memory Limits In Go
40mGolang memory footprint
51mObscure Go Optimisations
51mEvolving the Go Memory Manager's RAM and CPU Efficiency
