

Join the discussion
Write your take first — we'll ask for email only when you're ready to publish.
- Hacker News
- When my system starts using swap space, I've already given up all hopes of a decently running system, so IMHO this particular "bug" doesn't matter much.
I'm being downvoted, but honestly, is anyone always testing their software while swap is active?
by amelius - A GC latency SLO should include operating-system memory pressure. Otherwise, a page-fault problem will look like a collector problem and lead to the wrong fix.by soltanov
- I started wondering if there could be swap-aware GC, like first make the required page swapped in (not that there's any obvious API for that...) and only then pause the world?by Gabrys1
- Choosing a language that forgives bad memory management practices and promotes sloppy programming practices is your decision. Don't be surprised that it has to do its job. You could have chosen modern C++ or Rust and use RAII and proper automatic deallocation.
- I use Go where i'd use Node, Ruby or Python.
I use Rust where i need low latency.
- "It hurts when I do this"
"Stop doing that"
If you care about latency, disable swap. System wide or for the specific the cgroup.
by jacobgold - 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...by xavdid
- 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.
by nasretdinov