|
|
On 3/15/2012 7:42, Warp wrote:
> A concurrent compacting GC sounds to me like a very hard problem.
Yes.
> If the GC moves objects around in RAM, it has to make sure that no code
> is modifying the object while the GC is moving it. How does it achieve
> that efficiently, I have no idea.
You wind up dividing the heap into multiple zones, based on whether you've
scanned the object, compacted the object, or haven't looked at the object.
If someone tries to write to an object you've scanned and assign it a
pointer to an object you haven't scanned, then at that point you move the
object from the unscanned to the scanned region.
If you set it up so writes cause page faults in that situation, you can get
really good performance by just GCing one page worth of objects each time
you hit that fault, which is the paper Andrew refers to.
--
Darren New, San Diego CA, USA (PST)
People tell me I am the counter-example.
Post a reply to this message
|
|