hotspot/src/share/vm/memory/genMarkSweep.cpp
changeset 3912 3aaaaad1ccb0
parent 3908 24b55ad4c228
parent 3696 9e5d9b5e1049
child 3919 b15d85d98b61
--- a/hotspot/src/share/vm/memory/genMarkSweep.cpp	Fri Sep 18 09:57:47 2009 -0700
+++ b/hotspot/src/share/vm/memory/genMarkSweep.cpp	Wed Sep 23 23:56:15 2009 -0700
@@ -162,6 +162,9 @@
 
   int size = SystemDictionary::number_of_classes() * 2;
   _revisit_klass_stack = new (ResourceObj::C_HEAP) GrowableArray<Klass*>(size, true);
+  // (#klass/k)^2 for k ~ 10 appears to be a better fit, but this will have to do for
+  // now until we have had a chance to investigate a more optimal setting.
+  _revisit_mdo_stack   = new (ResourceObj::C_HEAP) GrowableArray<DataLayout*>(2*size, true);
 
 #ifdef VALIDATE_MARK_SWEEP
   if (ValidateMarkSweep) {
@@ -206,6 +209,7 @@
 
   delete _marking_stack;
   delete _revisit_klass_stack;
+  delete _revisit_mdo_stack;
 
 #ifdef VALIDATE_MARK_SWEEP
   if (ValidateMarkSweep) {
@@ -265,6 +269,10 @@
   follow_weak_klass_links();
   assert(_marking_stack->is_empty(), "just drained");
 
+  // Visit memoized MDO's and clear any unmarked weak refs
+  follow_mdo_weak_refs();
+  assert(_marking_stack->is_empty(), "just drained");
+
   // Visit symbol and interned string tables and delete unmarked oops
   SymbolTable::unlink(&is_alive);
   StringTable::unlink(&is_alive);