1.1 --- a/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp Mon Aug 31 05:27:29 2009 -0700 1.2 +++ b/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp Wed Sep 02 00:04:29 2009 -0700 1.3 @@ -102,9 +102,14 @@ 1.4 GenMarkSweep::_marking_stack = 1.5 new (ResourceObj::C_HEAP) GrowableArray<oop>(4000, true); 1.6 1.7 - size_t size = SystemDictionary::number_of_classes() * 2; 1.8 + int size = SystemDictionary::number_of_classes() * 2; 1.9 GenMarkSweep::_revisit_klass_stack = 1.10 - new (ResourceObj::C_HEAP) GrowableArray<Klass*>((int)size, true); 1.11 + new (ResourceObj::C_HEAP) GrowableArray<Klass*>(size, true); 1.12 + // (#klass/k)^2 for k ~ 10 appears a better fit, but this will have to do 1.13 + // for now until we have a chance to work out a more optimal setting. 1.14 + GenMarkSweep::_revisit_mdo_stack = 1.15 + new (ResourceObj::C_HEAP) GrowableArray<DataLayout*>(size*2, true); 1.16 + 1.17 } 1.18 1.19 void G1MarkSweep::mark_sweep_phase1(bool& marked_for_unloading, 1.20 @@ -139,13 +144,18 @@ 1.21 CodeCache::do_unloading(&GenMarkSweep::is_alive, 1.22 &GenMarkSweep::keep_alive, 1.23 purged_class); 1.24 - GenMarkSweep::follow_stack(); 1.25 + GenMarkSweep::follow_stack(); 1.26 1.27 // Update subklass/sibling/implementor links of live klasses 1.28 GenMarkSweep::follow_weak_klass_links(); 1.29 assert(GenMarkSweep::_marking_stack->is_empty(), 1.30 "stack should be empty by now"); 1.31 1.32 + // Visit memoized MDO's and clear any unmarked weak refs 1.33 + GenMarkSweep::follow_mdo_weak_refs(); 1.34 + assert(GenMarkSweep::_marking_stack->is_empty(), "just drained"); 1.35 + 1.36 + 1.37 // Visit symbol and interned string tables and delete unmarked oops 1.38 SymbolTable::unlink(&GenMarkSweep::is_alive); 1.39 StringTable::unlink(&GenMarkSweep::is_alive);