Go Runtime GC Deep Dive¶
Comprehensive analysis of Go's garbage collector implementation (Go 1.23.12), covering theory from source code to production tuning at scale.
Articles¶
Core GC Mechanisms¶
- 01. GC Pacer - How GC decides when to trigger
- 02. GC Sweep - Lazy sweep and bit flipping
- 03. GC Mark - Concurrent marking and STW
- 04. GC Mutator - Write barrier mechanics
Runtime Integration¶
- 05. Allocation and GC - How allocation triggers GC
- 06. Scavenging - Memory return to OS
- 07. STW to Scan Stack - Stack scanning
Production Case Study¶
- 08. GC Tuner Case Study - Large-scale tuning: 67 services, 49K instances, 1.11 PB memory
Reading Order¶
Complete path: 01 → 02 → 03 → 04 → 05 → 06 → 07 → 08
Quick reference: - Production tuning → 01, 05, 06, 08 - Interview prep → 01-04 - STW debugging → 03, 07
Source Code¶
Go 1.23.12: - src/runtime/mgcpacer.go - src/runtime/mgcsweep.go - src/runtime/mgcmark.go - src/runtime/mbarrier.go