Brooks Pointer In Object Class
Solution 1:
Roman's Blog explains how his GC implementation works.
It's a new feature in the Shenandoah GC, which allows application threads to interact with objects in heap while they're being moved around during compacting (moving referenced objects to a better location), removing the need to "stop-the-world"
Before this, it was required to prevent access to referenced objects while the GC moved them, to ensure no one can access the object until it's in it's new location. If you tried accessing the object, but the GC has already moved it, problems will occur. This is why we have "stop-the-world" when it's time to GC (no threads are allowed to access objects in heap for safety measures). While objects are moving around, the object graph is considered to be inconsistent, so it's best to prevent access to it.
With this new system, a forwarding pointer (scroll down to forwarding pointer) is put in the place the referenced object used to be, which references the object's new location. Now we don't have to worry about the object not being there if the GC were to move it, since we can still reference it through the forwarding pointer. We can now access the object while the GC is moving it around, which means we no longer need to prevent access during compacting.
The "forwarding pointer" I'm referring to is Brooks Pointer
Post a Comment for "Brooks Pointer In Object Class"