8027423: Parallel compact GC class unloading measurement includes symbol and string table time

Reviewed-by: mgerdin, jmasa
This commit is contained in:
Stefan Karlsson 2016-03-17 21:01:59 +01:00
parent 7c87080ac1
commit 35058d4038
5 changed files with 83 additions and 45 deletions

View file

@ -4098,14 +4098,10 @@ void G1CollectedHeap::parallel_cleaning(BoolObjectClosure* is_alive,
void G1CollectedHeap::unlink_string_and_symbol_table(BoolObjectClosure* is_alive, void G1CollectedHeap::unlink_string_and_symbol_table(BoolObjectClosure* is_alive,
bool process_strings, bool process_symbols) { bool process_strings, bool process_symbols) {
{ { // Timing scope
G1StringSymbolTableUnlinkTask g1_unlink_task(is_alive, process_strings, process_symbols); G1StringSymbolTableUnlinkTask g1_unlink_task(is_alive, process_strings, process_symbols);
workers()->run_task(&g1_unlink_task); workers()->run_task(&g1_unlink_task);
} }
if (G1StringDedup::is_enabled()) {
G1StringDedup::unlink(is_alive);
}
} }
class G1RedirtyLoggedCardsTask : public AbstractGangTask { class G1RedirtyLoggedCardsTask : public AbstractGangTask {

View file

@ -154,17 +154,29 @@ void G1MarkSweep::mark_sweep_phase1(bool& marked_for_unloading,
// This is the point where the entire marking should have completed. // This is the point where the entire marking should have completed.
assert(GenMarkSweep::_marking_stack.is_empty(), "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) trace("Class Unloading", gc_timer());
// Unload nmethods. // Unload classes and purge the SystemDictionary.
CodeCache::do_unloading(&GenMarkSweep::is_alive, purged_class); bool purged_class = SystemDictionary::do_unloading(&GenMarkSweep::is_alive);
// Prune dead klasses from subklass/sibling/implementor lists. // Unload nmethods.
Klass::clean_weak_klass_links(&GenMarkSweep::is_alive); CodeCache::do_unloading(&GenMarkSweep::is_alive, purged_class);
// Delete entries for dead interned string and clean up unreferenced symbols in symbol table. // Prune dead klasses from subklass/sibling/implementor lists.
g1h->unlink_string_and_symbol_table(&GenMarkSweep::is_alive); Klass::clean_weak_klass_links(&GenMarkSweep::is_alive);
}
{
GCTraceTime(Debug, gc) trace("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 (G1StringDedup::is_enabled()) {
GCTraceTime(Debug, gc) trace("String Deduplication Unlink", gc_timer());
G1StringDedup::unlink(&GenMarkSweep::is_alive);
}
if (VerifyDuringGC) { if (VerifyDuringGC) {
HandleMark hm; // handle scope HandleMark hm; // handle scope

View file

@ -533,20 +533,31 @@ void PSMarkSweep::mark_sweep_phase1(bool clear_all_softrefs) {
// This is the point where the entire marking should have completed. // This is the point where the entire marking should have completed.
assert(_marking_stack.is_empty(), "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. // Unload classes and purge the SystemDictionary.
CodeCache::do_unloading(is_alive_closure(), purged_class); bool purged_class = SystemDictionary::do_unloading(is_alive_closure());
// Prune dead klasses from subklass/sibling/implementor lists. // Unload nmethods.
Klass::clean_weak_klass_links(is_alive_closure()); CodeCache::do_unloading(is_alive_closure(), purged_class);
// Delete entries for dead interned strings. // Prune dead klasses from subklass/sibling/implementor lists.
StringTable::unlink(is_alive_closure()); 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()); _gc_tracer->report_object_count_after_gc(is_alive_closure());
} }

View file

@ -2103,25 +2103,34 @@ void PSParallelCompact::marking_phase(ParCompactionManager* cm,
gc_tracer->report_gc_reference_stats(stats); 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. // This is the point where the entire marking should have completed.
assert(cm->marking_stacks_empty(), "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);
// Unload nmethods. // Follow system dictionary roots and unload classes.
CodeCache::do_unloading(is_alive_closure(), purged_class); bool purged_class = SystemDictionary::do_unloading(is_alive_closure());
// Prune dead klasses from subklass/sibling/implementor lists. // Unload nmethods.
Klass::clean_weak_klass_links(is_alive_closure()); CodeCache::do_unloading(is_alive_closure(), purged_class);
// Delete entries for dead interned strings. // Prune dead klasses from subklass/sibling/implementor lists.
StringTable::unlink(is_alive_closure()); 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()); _gc_tracer.report_object_count_after_gc(is_alive_closure());
} }

View file

@ -218,20 +218,30 @@ void GenMarkSweep::mark_sweep_phase1(bool clear_all_softrefs) {
// This is the point where the entire marking should have completed. // This is the point where the entire marking should have completed.
assert(_marking_stack.is_empty(), "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. // Unload classes and purge the SystemDictionary.
CodeCache::do_unloading(&is_alive, purged_class); bool purged_class = SystemDictionary::do_unloading(&is_alive);
// Prune dead klasses from subklass/sibling/implementor lists. // Unload nmethods.
Klass::clean_weak_klass_links(&is_alive); CodeCache::do_unloading(&is_alive, purged_class);
// Delete entries for dead interned strings. // Prune dead klasses from subklass/sibling/implementor lists.
StringTable::unlink(&is_alive); Klass::clean_weak_klass_links(&is_alive);
}
// Clean up unreferenced symbols in symbol table. {
SymbolTable::unlink(); 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); gc_tracer()->report_object_count_after_gc(&is_alive);
} }