Watching Go's new garbage collector move through the heap
theconsensus.dev - 94 poäng - 7 kommentarer - 219778 sekunder sedan
Kommentarer (4)
- nomorewords - 5488 sekunder sedanThis was very interesting, but the ending was a bit abrupt. I was under the impression that there was something more that I was missing under the subscribe banner.
But to the point of the article - are there cases in which manually moving objects around to compact them in a specific area is done with golang? I don't use golang that much, and I'm sure that there are very strong arguments for not compacting the heap post-GC, but I've always wondered how it avoids crashing in the 0.0001% of cases in which heap is defragmented in such a way that there's no way to allocate a new large object
- owaislone - 5017 sekunder sedanFor anyone interested in this - https://www.youtube.com/watch?v=gPJkM95KpKo
- okzgn - 3617 sekunder sedanExcellent optimization technique: manually copying objects to a new slice so they don't prevent the GC from releasing memory by sitting right in the middle of a page it intends to free.
- extra-AI - 2248 sekunder sedanBut if the objects being scanned are already located on the same page, aren’t we just wasting time managing the page and tracking the objects within it?
Nördnytt! 🤓