src/share/vm/gc_implementation/g1/g1GCPhaseTimes.cpp
Print this page
@@ -25,10 +25,11 @@
#include "precompiled.hpp"
#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
#include "gc_implementation/g1/g1GCPhaseTimes.hpp"
#include "gc_implementation/g1/g1Log.hpp"
+#include "gc_implementation/g1/g1StringDedup.hpp"
// Helper class for avoiding interleaved logging
class LineBuffer: public StackObj {
private:
@@ -166,11 +167,13 @@
_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")
+ _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) {
@@ -227,10 +230,20 @@
_last_gc_worker_times_ms.verify();
_last_gc_worker_other_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);
}
void G1GCPhaseTimes::print_stats(int level, const char* str, double value, int workers) {
@@ -248,10 +261,15 @@
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;
+ if (G1StringDedup::is_enabled()) {
+ // String dedup fixup time
+ 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,10 +315,15 @@
_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 (G1StringDedup::is_enabled()) {
+ 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);