--- old/src/share/vm/gc/g1/g1MarkSweep.cpp 2016-03-14 14:53:57.870852251 +0100 +++ new/src/share/vm/gc/g1/g1MarkSweep.cpp 2016-03-14 14:53:57.754848322 +0100 @@ -154,17 +154,24 @@ // This is the point where the entire marking should have completed. assert(GenMarkSweep::_marking_stack.is_empty(), "Marking should have completed"); - // Unload classes and purge the SystemDictionary. - bool purged_class = SystemDictionary::do_unloading(&GenMarkSweep::is_alive); + { + GCTraceTime(Debug, gc) tm_m("Class Unloading", gc_timer()); - // Unload nmethods. - CodeCache::do_unloading(&GenMarkSweep::is_alive, purged_class); + // Unload classes and purge the SystemDictionary. + bool purged_class = SystemDictionary::do_unloading(&GenMarkSweep::is_alive); - // Prune dead klasses from subklass/sibling/implementor lists. - Klass::clean_weak_klass_links(&GenMarkSweep::is_alive); + // Unload nmethods. + CodeCache::do_unloading(&GenMarkSweep::is_alive, purged_class); - // Delete entries for dead interned string and clean up unreferenced symbols in symbol table. - g1h->unlink_string_and_symbol_table(&GenMarkSweep::is_alive); + // Prune dead klasses from subklass/sibling/implementor lists. + Klass::clean_weak_klass_links(&GenMarkSweep::is_alive); + } + + { + GCTraceTime(Debug, gc) t("Scrub String and Symbol Tables", gc_timer()); + // Delete entries for dead interned string and clean up unreferenced symbols in symbol table. + g1h->unlink_string_and_symbol_table(&GenMarkSweep::is_alive); + } if (VerifyDuringGC) { HandleMark hm; // handle scope --- old/src/share/vm/gc/parallel/psMarkSweep.cpp 2016-03-14 14:53:58.146861598 +0100 +++ new/src/share/vm/gc/parallel/psMarkSweep.cpp 2016-03-14 14:53:57.974855773 +0100 @@ -533,20 +533,31 @@ // This is the point where the entire marking should have completed. assert(_marking_stack.is_empty(), "Marking should have completed"); - // Unload classes and purge the SystemDictionary. - bool purged_class = SystemDictionary::do_unloading(is_alive_closure()); + { + GCTraceTime(Debug, gc) t("Class Unloading", _gc_timer); - // Unload nmethods. - CodeCache::do_unloading(is_alive_closure(), purged_class); + // Unload classes and purge the SystemDictionary. + bool purged_class = SystemDictionary::do_unloading(is_alive_closure()); - // Prune dead klasses from subklass/sibling/implementor lists. - Klass::clean_weak_klass_links(is_alive_closure()); + // Unload nmethods. + CodeCache::do_unloading(is_alive_closure(), purged_class); - // Delete entries for dead interned strings. - StringTable::unlink(is_alive_closure()); + // Prune dead klasses from subklass/sibling/implementor lists. + Klass::clean_weak_klass_links(is_alive_closure()); + } + + { + GCTraceTime(Debug, gc) t("Scrub String Table", _gc_timer); + // Delete entries for dead interned strings. + StringTable::unlink(is_alive_closure()); + } + + { + GCTraceTime(Debug, gc) t("Scrub Symbol Table", _gc_timer); + // Clean up unreferenced symbols in symbol table. + SymbolTable::unlink(); + } - // Clean up unreferenced symbols in symbol table. - SymbolTable::unlink(); _gc_tracer->report_object_count_after_gc(is_alive_closure()); } --- old/src/share/vm/gc/parallel/psParallelCompact.cpp 2016-03-14 14:53:58.418870809 +0100 +++ new/src/share/vm/gc/parallel/psParallelCompact.cpp 2016-03-14 14:53:58.262865526 +0100 @@ -2103,25 +2103,34 @@ gc_tracer->report_gc_reference_stats(stats); } - GCTraceTime(Trace, gc) tm_m("Class Unloading", &_gc_timer); - // This is the point where the entire marking should have completed. assert(cm->marking_stacks_empty(), "Marking should have completed"); - // Follow system dictionary roots and unload classes. - bool purged_class = SystemDictionary::do_unloading(is_alive_closure()); + { + GCTraceTime(Debug, gc) tm_m("Class Unloading", &_gc_timer); + + // Follow system dictionary roots and unload classes. + bool purged_class = SystemDictionary::do_unloading(is_alive_closure()); + + // Unload nmethods. + CodeCache::do_unloading(is_alive_closure(), purged_class); - // Unload nmethods. - CodeCache::do_unloading(is_alive_closure(), purged_class); + // Prune dead klasses from subklass/sibling/implementor lists. + Klass::clean_weak_klass_links(is_alive_closure()); + } - // Prune dead klasses from subklass/sibling/implementor lists. - Klass::clean_weak_klass_links(is_alive_closure()); + { + GCTraceTime(Debug, gc) t("Scrub String Table", &_gc_timer); + // Delete entries for dead interned strings. + StringTable::unlink(is_alive_closure()); + } - // Delete entries for dead interned strings. - StringTable::unlink(is_alive_closure()); + { + GCTraceTime(Debug, gc) t("Scrub Symbol Table", &_gc_timer); + // Clean up unreferenced symbols in symbol table. + SymbolTable::unlink(); + } - // Clean up unreferenced symbols in symbol table. - SymbolTable::unlink(); _gc_tracer.report_object_count_after_gc(is_alive_closure()); } --- old/src/share/vm/gc/serial/genMarkSweep.cpp 2016-03-14 14:53:58.742881781 +0100 +++ new/src/share/vm/gc/serial/genMarkSweep.cpp 2016-03-14 14:53:58.606877176 +0100 @@ -218,20 +218,30 @@ // This is the point where the entire marking should have completed. assert(_marking_stack.is_empty(), "Marking should have completed"); - // Unload classes and purge the SystemDictionary. - bool purged_class = SystemDictionary::do_unloading(&is_alive); + { + GCTraceTime(Debug, gc) tm_m("Class Unloading", gc_timer()); - // Unload nmethods. - CodeCache::do_unloading(&is_alive, purged_class); + // Unload classes and purge the SystemDictionary. + bool purged_class = SystemDictionary::do_unloading(&is_alive); - // Prune dead klasses from subklass/sibling/implementor lists. - Klass::clean_weak_klass_links(&is_alive); + // Unload nmethods. + CodeCache::do_unloading(&is_alive, purged_class); - // Delete entries for dead interned strings. - StringTable::unlink(&is_alive); - - // Clean up unreferenced symbols in symbol table. - SymbolTable::unlink(); + // Prune dead klasses from subklass/sibling/implementor lists. + Klass::clean_weak_klass_links(&is_alive); + } + + { + GCTraceTime(Debug, gc) t("Scrub String Table", gc_timer()); + // Delete entries for dead interned strings. + StringTable::unlink(&is_alive); + } + + { + GCTraceTime(Debug, gc) t("Scrub Symbol Table", gc_timer()); + // Clean up unreferenced symbols in symbol table. + SymbolTable::unlink(); + } gc_tracer()->report_object_count_after_gc(&is_alive); }