Evolving the Go Memory Manager's RAM and CPU Efficiency
summary
Recent runtime work (Go 1.12–1.14) fixes a broken best-fit tree via unit tests, adds a background highest-address-first scavenger that returns memory gradually with ~10% headroom, and replaces the global free-tree with a summarized bitmap with processor-local caches. Result: fragmentation and OOMs drop, Kubernetes/internal services show ~10–20% lower average memory, allocation-heavy benchmarks see up to ~30% throughput and ~20% tail-latency improvements, and locking collapse on many cores is eliminated.
AI-written summary · about
chapters (14)
- 0:00Intro
- 0:20Overview
- 4:43Orientation
- 5:39Dynamic Memory Allocation
- 7:25The Heap Memory "Lifecycle"
- 10:37Talking policy
- 12:22Scenario: Large allocation to fragmented heap
- 23:41Picking a policy
- 30:43Scenario: Heap Spikes
- 33:56Lock collapse
- 40:25Bitmaps!
- 41:33Caching pages
- 42:53Summarizing the bitmap
- 48:59Takeaways
related talks
30mMemory Management in Go: The good, the bad and the ugly
26mRespecting Memory Limits In Go
19mHeap Optimization for Go Systems
48mGolang's Garbage
14mMemory Optimization through Structure Packaging
50mUnderstanding the Go runtime
56mThe Key to Go Efficiency is Just a Few Go Runtime Metrics Away!
38mUnderstanding Memory Allocation in Go
