A 40ms Go garbage collector pause caused by swap
Summary
The article documents a 40ms stop-the-world pause in Go's garbage collector caused by swapping under memory pressure, detailing how GC metadata reads can be swapped out and lead to major page faults. It describes experiments (MGLRU, NVMe metadata, and a BPF-based fault counter) and highlights the impact on Go allocations and network message timing, with an update noting Go 1.26's Green Tea GC has negligible change. The author emphasizes swap isn’t inherently evil but can interact poorly with GC in production workloads.