<- Back
Comments (93)
- nasretdinovUnfortunately 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.
- jacobgold"It hurts when I do this""Stop doing that"If you care about latency, disable swap. System wide or for the specific the cgroup.
- xavdidDiscord learned this back in 2020 and published a great blog post on it: https://discord.com/blog/why-discord-is-switching-from-go-to...
- pizlonatorIs there a reason why Go isn’t using on the fly GC, where there’s no STW at all?
- soltanovA 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.
- Gabrys1I 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?
- imclarenThis. Memory bloat bugs are relatively easy to fix in Go, but sometimes it’s an adventure to remove swap bloat. And I think it’s worth removing all swap bloat!
- faangguyindiaI use Go where i'd use Node, Ruby or Python.I use Rust where i need low latency.
- ahmedmostafa16The nasty bit is that swap doesn't just make the allocation slower; if GC metadata gets paged out, you have turned memory pressure into a stop-the-world latency spike.
- charcircuitIf memory is paged out we could defer cleaning out garbage from it.
- raverbashingI don't get why people do not prefer reference counting, it has more predictable runtime performance(though of course a swap is a swap - but you can "trigger" it depending on your memory or file access pattern)
- ameliusWhen 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?
- loegSo, uh, mlock those pages?
- octoberfranklinYet another reason why "no runtime" is such a huge advantage.
- lin7c[flagged]
- palaceme[flagged]
- truth_seekerWhat is stopping the author to use latest version of Go and Linux Kernel ?