2165 // We need to make this be a "collection" so any collection pause that |
2165 // We need to make this be a "collection" so any collection pause that |
2166 // races with it goes around and waits for completeCleanup to finish. |
2166 // races with it goes around and waits for completeCleanup to finish. |
2167 g1h->increment_total_collections(); |
2167 g1h->increment_total_collections(); |
2168 |
2168 |
2169 // Clean out dead classes and update Metaspace sizes. |
2169 // Clean out dead classes and update Metaspace sizes. |
2170 ClassLoaderDataGraph::purge(); |
2170 if (ClassUnloadingWithConcurrentMark) { |
|
2171 ClassLoaderDataGraph::purge(); |
|
2172 } |
2171 MetaspaceGC::compute_new_size(); |
2173 MetaspaceGC::compute_new_size(); |
2172 |
2174 |
2173 // We reclaimed old regions so we should calculate the sizes to make |
2175 // We reclaimed old regions so we should calculate the sizes to make |
2174 // sure we update the old gen/space data. |
2176 // sure we update the old gen/space data. |
2175 g1h->g1mm()->update_sizes(); |
2177 g1h->g1mm()->update_sizes(); |
2595 } |
2597 } |
2596 |
2598 |
2597 assert(_markStack.isEmpty(), "Marking should have completed"); |
2599 assert(_markStack.isEmpty(), "Marking should have completed"); |
2598 |
2600 |
2599 // Unload Klasses, String, Symbols, Code Cache, etc. |
2601 // Unload Klasses, String, Symbols, Code Cache, etc. |
2600 |
|
2601 G1RemarkGCTraceTime trace("Unloading", G1Log::finer()); |
|
2602 |
|
2603 bool purged_classes; |
|
2604 |
|
2605 { |
2602 { |
2606 G1RemarkGCTraceTime trace("System Dictionary Unloading", G1Log::finest()); |
2603 G1RemarkGCTraceTime trace("Unloading", G1Log::finer()); |
2607 purged_classes = SystemDictionary::do_unloading(&g1_is_alive); |
2604 |
2608 } |
2605 if (ClassUnloadingWithConcurrentMark) { |
2609 |
2606 bool purged_classes; |
2610 { |
2607 |
2611 G1RemarkGCTraceTime trace("Parallel Unloading", G1Log::finest()); |
2608 { |
2612 weakRefsWorkParallelPart(&g1_is_alive, purged_classes); |
2609 G1RemarkGCTraceTime trace("System Dictionary Unloading", G1Log::finest()); |
2613 } |
2610 purged_classes = SystemDictionary::do_unloading(&g1_is_alive); |
2614 |
2611 } |
2615 if (G1StringDedup::is_enabled()) { |
2612 |
2616 G1RemarkGCTraceTime trace("String Deduplication Unlink", G1Log::finest()); |
2613 { |
2617 G1StringDedup::unlink(&g1_is_alive); |
2614 G1RemarkGCTraceTime trace("Parallel Unloading", G1Log::finest()); |
|
2615 weakRefsWorkParallelPart(&g1_is_alive, purged_classes); |
|
2616 } |
|
2617 } |
|
2618 |
|
2619 if (G1StringDedup::is_enabled()) { |
|
2620 G1RemarkGCTraceTime trace("String Deduplication Unlink", G1Log::finest()); |
|
2621 G1StringDedup::unlink(&g1_is_alive); |
|
2622 } |
2618 } |
2623 } |
2619 } |
2624 } |
2620 |
2625 |
2621 void ConcurrentMark::swapMarkBitMaps() { |
2626 void ConcurrentMark::swapMarkBitMaps() { |
2622 CMBitMapRO* temp = _prevMarkBitMap; |
2627 CMBitMapRO* temp = _prevMarkBitMap; |