1.1 --- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Thu May 22 09:12:29 2014 +0200 1.2 +++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Fri Apr 11 11:00:12 2014 +0200 1.3 @@ -435,6 +435,9 @@ 1.4 void G1CollectedHeap::stop_conc_gc_threads() { 1.5 _cg1r->stop(); 1.6 _cmThread->stop(); 1.7 + if (G1StringDedup::is_enabled()) { 1.8 + G1StringDedup::stop(); 1.9 + } 1.10 } 1.11 1.12 #ifdef ASSERT 1.13 @@ -2182,6 +2185,16 @@ 1.14 return JNI_OK; 1.15 } 1.16 1.17 +void G1CollectedHeap::stop() { 1.18 + // Abort any ongoing concurrent root region scanning and stop all 1.19 + // concurrent threads. We do this to make sure these threads do 1.20 + // not continue to execute and access resources (e.g. gclog_or_tty) 1.21 + // that are destroyed during shutdown. 1.22 + _cm->root_regions()->abort(); 1.23 + _cm->root_regions()->wait_until_scan_finished(); 1.24 + stop_conc_gc_threads(); 1.25 +} 1.26 + 1.27 size_t G1CollectedHeap::conservative_max_heap_alignment() { 1.28 return HeapRegion::max_region_size(); 1.29 }