A 40ms Go garbage collector pause caused by swap

frn.sh

115 points by shellpipe 3 days ago


nasretdinov - 3 days ago

Unfortunately that's somewhat expected - regardless of implementation, the sole fact that the GC needs to somehow walk the entire tree to trace still referenced sections makes swap highly impractical -- even if you had not had 40ms stop-the-world pauses the LRU cache used by swap would get thrown away at every GC.

I believe that's actually the same reason why Apple stopped using GC in their frameworks in favour of automatic reference counting.

xavdid - 3 days ago

Discord learned this back in 2020 and published a great blog post on it: https://discord.com/blog/why-discord-is-switching-from-go-to...

jacobgold - 3 days ago

"It hurts when I do this"

"Stop doing that"

If you care about latency, disable swap. System wide or for the specific the cgroup.