Permalink
Browse files

Don't remove finalized objects from remember set

With concurrent GC this can cause problems. The issue is that the
concurrent mark stack still has a reference to an object that makes this
finalized object reachable. This is because the concurrent GC started
when the object was still reachable and not yet scheduled for
finalization.

The finalization itself is fine here and not problematic, but the
problem occurs when it's removed from the remember set. This finalized
mature object might hold references to young objects. If during the time
of the mature mark phase, we run additional young GC's, these references
become invalid since the finalized object is no longer remembered.

Not removing this from the remember set ensures we keep updating these
young objects so they stay reachable for the concurrent marking phase.
This results in these objects staying alive somewhat longer than
necessary, namely until the next mature GC phase. There is however no
way around this since we need to ensure that during concurrent marking,
no objects go out of scope that are still reachable in some form.
  • Loading branch information...
1 parent 20ecde5 commit b1c65d7e8d90e5ad3d1f63c8dc2c2f1f3e0508d6 @dbussink dbussink committed Jun 6, 2013
Showing with 0 additions and 5 deletions.
  1. +0 −5 vm/gc/finalize.cpp
View
5 vm/gc/finalize.cpp
@@ -295,11 +295,6 @@ namespace rubinius {
process_item_->object->clear_handle(state);
}
- // If the object was remembered, unremember it.
- if(process_item_->object->remembered_p()) {
- state->memory()->unremember_object(process_item_->object);
- }
-
process_item_->status = FinalizeObject::eReleased;
break;

0 comments on commit b1c65d7

Please sign in to comment.