comparison src/share/vm/gc_implementation/g1/concurrentMark.cpp @ 20282:f3aeae1f9fc5

8048269: Add flag to turn off class unloading after G1 concurrent mark Summary: Added -XX:+/-ClassUnloadingWithConcurrentMark Reviewed-by: jmasa, brutisso, mgerdin
author stefank
date Wed, 06 Aug 2014 09:55:16 +0200
parents 2c6ef90f030a
children e0954897238a 3bf2fc51186b
comparison
equal deleted inserted replaced
20281:684a5dec6072 20282:f3aeae1f9fc5
2155 // We need to make this be a "collection" so any collection pause that 2155 // We need to make this be a "collection" so any collection pause that
2156 // races with it goes around and waits for completeCleanup to finish. 2156 // races with it goes around and waits for completeCleanup to finish.
2157 g1h->increment_total_collections(); 2157 g1h->increment_total_collections();
2158 2158
2159 // Clean out dead classes and update Metaspace sizes. 2159 // Clean out dead classes and update Metaspace sizes.
2160 ClassLoaderDataGraph::purge(); 2160 if (ClassUnloadingWithConcurrentMark) {
2161 ClassLoaderDataGraph::purge();
2162 }
2161 MetaspaceGC::compute_new_size(); 2163 MetaspaceGC::compute_new_size();
2162 2164
2163 // We reclaimed old regions so we should calculate the sizes to make 2165 // We reclaimed old regions so we should calculate the sizes to make
2164 // sure we update the old gen/space data. 2166 // sure we update the old gen/space data.
2165 g1h->g1mm()->update_sizes(); 2167 g1h->g1mm()->update_sizes();
2583 } 2585 }
2584 2586
2585 assert(_markStack.isEmpty(), "Marking should have completed"); 2587 assert(_markStack.isEmpty(), "Marking should have completed");
2586 2588
2587 // Unload Klasses, String, Symbols, Code Cache, etc. 2589 // Unload Klasses, String, Symbols, Code Cache, etc.
2588
2589 G1RemarkGCTraceTime trace("Unloading", G1Log::finer());
2590
2591 bool purged_classes;
2592
2593 { 2590 {
2594 G1RemarkGCTraceTime trace("System Dictionary Unloading", G1Log::finest()); 2591 G1RemarkGCTraceTime trace("Unloading", G1Log::finer());
2595 purged_classes = SystemDictionary::do_unloading(&g1_is_alive); 2592
2596 } 2593 if (ClassUnloadingWithConcurrentMark) {
2597 2594 bool purged_classes;
2598 { 2595
2599 G1RemarkGCTraceTime trace("Parallel Unloading", G1Log::finest()); 2596 {
2600 weakRefsWorkParallelPart(&g1_is_alive, purged_classes); 2597 G1RemarkGCTraceTime trace("System Dictionary Unloading", G1Log::finest());
2601 } 2598 purged_classes = SystemDictionary::do_unloading(&g1_is_alive);
2602 2599 }
2603 if (G1StringDedup::is_enabled()) { 2600
2604 G1RemarkGCTraceTime trace("String Deduplication Unlink", G1Log::finest()); 2601 {
2605 G1StringDedup::unlink(&g1_is_alive); 2602 G1RemarkGCTraceTime trace("Parallel Unloading", G1Log::finest());
2603 weakRefsWorkParallelPart(&g1_is_alive, purged_classes);
2604 }
2605 }
2606
2607 if (G1StringDedup::is_enabled()) {
2608 G1RemarkGCTraceTime trace("String Deduplication Unlink", G1Log::finest());
2609 G1StringDedup::unlink(&g1_is_alive);
2610 }
2606 } 2611 }
2607 } 2612 }
2608 2613
2609 void ConcurrentMark::swapMarkBitMaps() { 2614 void ConcurrentMark::swapMarkBitMaps() {
2610 CMBitMapRO* temp = _prevMarkBitMap; 2615 CMBitMapRO* temp = _prevMarkBitMap;