src/share/vm/gc_implementation/g1/g1GCPhaseTimes.cpp

Print this page
rev 6069 : 8029075: String deduplication in G1
Implementation of JEP 192, http://openjdk.java.net/jeps/192

*** 166,176 **** _last_obj_copy_times_ms(_max_gc_threads, "%.1lf"), _last_termination_times_ms(_max_gc_threads, "%.1lf"), _last_termination_attempts(_max_gc_threads, SIZE_FORMAT), _last_gc_worker_end_times_ms(_max_gc_threads, "%.1lf", false), _last_gc_worker_times_ms(_max_gc_threads, "%.1lf"), ! _last_gc_worker_other_times_ms(_max_gc_threads, "%.1lf") { assert(max_gc_threads > 0, "Must have some GC threads"); } void G1GCPhaseTimes::note_gc_start(uint active_gc_threads) { --- 166,178 ---- _last_obj_copy_times_ms(_max_gc_threads, "%.1lf"), _last_termination_times_ms(_max_gc_threads, "%.1lf"), _last_termination_attempts(_max_gc_threads, SIZE_FORMAT), _last_gc_worker_end_times_ms(_max_gc_threads, "%.1lf", false), _last_gc_worker_times_ms(_max_gc_threads, "%.1lf"), ! _last_gc_worker_other_times_ms(_max_gc_threads, "%.1lf"), ! _cur_string_dedup_queue_fixup_worker_times_ms(_max_gc_threads, "%.1lf"), ! _cur_string_dedup_table_fixup_worker_times_ms(_max_gc_threads, "%.1lf") { assert(max_gc_threads > 0, "Must have some GC threads"); } void G1GCPhaseTimes::note_gc_start(uint active_gc_threads) {
*** 190,199 **** --- 192,204 ---- _last_termination_times_ms.reset(); _last_termination_attempts.reset(); _last_gc_worker_end_times_ms.reset(); _last_gc_worker_times_ms.reset(); _last_gc_worker_other_times_ms.reset(); + + _cur_string_dedup_queue_fixup_worker_times_ms.reset(); + _cur_string_dedup_table_fixup_worker_times_ms.reset(); } void G1GCPhaseTimes::note_gc_end() { _last_gc_worker_start_times_ms.verify(); _last_ext_root_scan_times_ms.verify();
*** 225,234 **** --- 230,252 ---- _last_gc_worker_other_times_ms.set(i, worker_other_time); } _last_gc_worker_times_ms.verify(); _last_gc_worker_other_times_ms.verify(); + + _cur_string_dedup_queue_fixup_worker_times_ms.verify(); + _cur_string_dedup_table_fixup_worker_times_ms.verify(); + } + + void G1GCPhaseTimes::note_string_dedup_fixup_start() { + _cur_string_dedup_queue_fixup_worker_times_ms.reset(); + _cur_string_dedup_table_fixup_worker_times_ms.reset(); + } + + void G1GCPhaseTimes::note_string_dedup_fixup_end() { + _cur_string_dedup_queue_fixup_worker_times_ms.verify(); + _cur_string_dedup_table_fixup_worker_times_ms.verify(); } void G1GCPhaseTimes::print_stats(int level, const char* str, double value) { LineBuffer(level).append_and_print_cr("[%s: %.1lf ms]", str, value); }
*** 248,257 **** --- 266,278 ---- misc_time_ms += _cur_collection_code_root_fixup_time_ms; // Strong code root migration time misc_time_ms += _cur_strong_code_root_migration_time_ms; + // Now subtract the time taken to fix up weak roots + misc_time_ms += _cur_string_dedup_fixup_time_ms; + // Subtract the time taken to clean the card table from the // current value of "other time" misc_time_ms += _cur_clear_ct_time_ms; return misc_time_ms;
*** 297,306 **** --- 318,332 ---- _last_strong_code_root_scan_times_ms.print(1, "Code Root Scanning (ms)"); _last_obj_copy_times_ms.print(1, "Object Copy (ms)"); } print_stats(1, "Code Root Fixup", _cur_collection_code_root_fixup_time_ms); print_stats(1, "Code Root Migration", _cur_strong_code_root_migration_time_ms); + if (UseStringDeduplication) { + print_stats(1, "String Dedup Fixup", _cur_string_dedup_fixup_time_ms, _active_gc_threads); + _cur_string_dedup_queue_fixup_worker_times_ms.print(2, "Queue Fixup (ms)"); + _cur_string_dedup_table_fixup_worker_times_ms.print(2, "Table Fixup (ms)"); + } print_stats(1, "Clear CT", _cur_clear_ct_time_ms); double misc_time_ms = pause_time_sec * MILLIUNITS - accounted_time_ms(); print_stats(1, "Other", misc_time_ms); if (_cur_verify_before_time_ms > 0.0) { print_stats(2, "Verify Before", _cur_verify_before_time_ms);