# Garbage Collector Pauses Due to Swapping During Go Program Execution for 40ms

- Link: https://frn.sh/go-gc/
- Discussion: https://startupxo.com/en/809/
- Posted by startupxo at 2026-10-05T07:05:14.263Z
- 0 points, 0 comments, kind story, origin curated
- Written in ko, machine translated to en

## Summary

- The garbage collector (GC) in Go language reads metadata during execution pauses, and if this data resides in the disk swap area, delays of tens of milliseconds occur.
- An experiment under Linux kernel 6.8 environment showed pauses lasting up to 40ms when reading GC metadata stored in swap, about 800 times longer than usual pauses (test conducted on Hetzner cloud).
- Swap manages pages on a cgroup basis, so memory of other processes grouped with the Go process can be swapped as well. GC interruptions were observed 312 times over 30 minutes.
- Unlike metadata pauses, message handling time for 511KiB increased from 3~5ms to 105ms on NVMe drives, and up to 903ms on remote network storage, but this only affected the goroutine executing the task.

## Sources

- Hacker News: https://news.ycombinator.com/item?id=49959654 (64 points, 28 comments, checked 2026-10-05T07:04:15Z)

## Comments (0)

No comments yet.

JSON: https://startupxo.com/api/v1/item.json?id=809&lang=en
