Re:Proposed New Go GC: Transaction-Oriented Collector
by ctangent on Friday June 24, 2016 @12:16PM
(#11970966)
The standard solution is that the write barrier updates a card table, which generally reserves a bit for every page. When it comes time to mark through old-to-young pointers, the collector scans the card table - if it sees a bit set in the card table, it must mark through /all objects/ on that page - even if only one of the objects on the page has a cross-generational pointer.
[ Parent
| on HN ]
Re:Proposed New Go GC: Transaction-Oriented Collector
by pcwalton on Friday June 24, 2016 @12:19PM
(#11971013)
Well, another solution (which I believe is common) is to just tenure the young object (and recursively tenure objects reachable from it) if the write barrier trips, which preserves the precision.
There isn't anything fundamental to generational GC that requires imprecision. It's an implementation detail. In fact, David Ungar's original generational GC paper from 1984 [1] uses precise remembered sets. GHC's GC [2] among others uses precise remembered sets.
[1]: https://people.cs.umass.edu/~emery/classes/cmpsci691s-fall20...
[2]: https://ghc.haskell.org/trac/ghc/wiki/Commentary/Rts/Storage...
Re:Proposed New Go GC: Transaction-Oriented Collector
by DblPlusUngood on Friday June 24, 2016 @12:28PM
(#11971091)
Tenuring the young object in the write-barrier is not correct since the the young objects reachable from the newly-tenured object won't be marked in the young collection. That is why TOC then traces this newly-tenured object, which is novel to my knowledge.
Re:Proposed New Go GC: Transaction-Oriented Collector
by pcwalton on Friday June 24, 2016 @12:35PM
(#11971165)
Yeah, of course you need to recursively tenure objects, and I should have been more precise about that. I've heard of doing this before; it isn't novel.
Re:Proposed New Go GC: Transaction-Oriented Collector
by DblPlusUngood on Friday June 24, 2016 @01:11PM
(#11971579)
My point was to compare TOC to "typical generational collectors" (i.e. those using card-marking, which is common).
My point was not that TOC is fundamentally different from generational collection.