src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp
changeset 53536 482109fae02b
parent 52897 495c05ee2a9a
child 53818 d85b3066ad22
equal deleted inserted replaced
53535:ce77e4d928f3 53536:482109fae02b
     1 /*
     1 /*
     2  * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    51   _gc_par_phases[GCWorkerStart] = new WorkerDataArray<double>(max_gc_threads, "GC Worker Start (ms):");
    51   _gc_par_phases[GCWorkerStart] = new WorkerDataArray<double>(max_gc_threads, "GC Worker Start (ms):");
    52   _gc_par_phases[ExtRootScan] = new WorkerDataArray<double>(max_gc_threads, "Ext Root Scanning (ms):");
    52   _gc_par_phases[ExtRootScan] = new WorkerDataArray<double>(max_gc_threads, "Ext Root Scanning (ms):");
    53 
    53 
    54   // Root scanning phases
    54   // Root scanning phases
    55   _gc_par_phases[ThreadRoots] = new WorkerDataArray<double>(max_gc_threads, "Thread Roots (ms):");
    55   _gc_par_phases[ThreadRoots] = new WorkerDataArray<double>(max_gc_threads, "Thread Roots (ms):");
    56   _gc_par_phases[StringTableRoots] = new WorkerDataArray<double>(max_gc_threads, "StringTable Roots (ms):");
       
    57   _gc_par_phases[UniverseRoots] = new WorkerDataArray<double>(max_gc_threads, "Universe Roots (ms):");
    56   _gc_par_phases[UniverseRoots] = new WorkerDataArray<double>(max_gc_threads, "Universe Roots (ms):");
    58   _gc_par_phases[JNIRoots] = new WorkerDataArray<double>(max_gc_threads, "JNI Handles Roots (ms):");
    57   _gc_par_phases[JNIRoots] = new WorkerDataArray<double>(max_gc_threads, "JNI Handles Roots (ms):");
    59   _gc_par_phases[ObjectSynchronizerRoots] = new WorkerDataArray<double>(max_gc_threads, "ObjectSynchronizer Roots (ms):");
    58   _gc_par_phases[ObjectSynchronizerRoots] = new WorkerDataArray<double>(max_gc_threads, "ObjectSynchronizer Roots (ms):");
    60   _gc_par_phases[ManagementRoots] = new WorkerDataArray<double>(max_gc_threads, "Management Roots (ms):");
    59   _gc_par_phases[ManagementRoots] = new WorkerDataArray<double>(max_gc_threads, "Management Roots (ms):");
    61   _gc_par_phases[SystemDictionaryRoots] = new WorkerDataArray<double>(max_gc_threads, "SystemDictionary Roots (ms):");
    60   _gc_par_phases[SystemDictionaryRoots] = new WorkerDataArray<double>(max_gc_threads, "SystemDictionary Roots (ms):");
   134   _cur_optional_evac_ms = 0.0;
   133   _cur_optional_evac_ms = 0.0;
   135   _cur_collection_code_root_fixup_time_ms = 0.0;
   134   _cur_collection_code_root_fixup_time_ms = 0.0;
   136   _cur_strong_code_root_purge_time_ms = 0.0;
   135   _cur_strong_code_root_purge_time_ms = 0.0;
   137   _cur_evac_fail_recalc_used = 0.0;
   136   _cur_evac_fail_recalc_used = 0.0;
   138   _cur_evac_fail_remove_self_forwards = 0.0;
   137   _cur_evac_fail_remove_self_forwards = 0.0;
   139   _cur_string_dedup_fixup_time_ms = 0.0;
   138   _cur_string_deduplication_time_ms = 0.0;
   140   _cur_prepare_tlab_time_ms = 0.0;
   139   _cur_prepare_tlab_time_ms = 0.0;
   141   _cur_resize_tlab_time_ms = 0.0;
   140   _cur_resize_tlab_time_ms = 0.0;
   142   _cur_derived_pointer_table_update_time_ms = 0.0;
   141   _cur_derived_pointer_table_update_time_ms = 0.0;
   143   _cur_clear_ct_time_ms = 0.0;
   142   _cur_clear_ct_time_ms = 0.0;
   144   _cur_expand_heap_time_ms = 0.0;
   143   _cur_expand_heap_time_ms = 0.0;
   288       details(work_items, Indents[indent + 1]);
   287       details(work_items, Indents[indent + 1]);
   289     }
   288     }
   290   }
   289   }
   291 }
   290 }
   292 
   291 
   293 void G1GCPhaseTimes::debug_phase(WorkerDataArray<double>* phase) const {
   292 void G1GCPhaseTimes::debug_phase(WorkerDataArray<double>* phase, uint extra_indent) const {
   294   LogTarget(Debug, gc, phases) lt;
   293   LogTarget(Debug, gc, phases) lt;
   295   if (lt.is_enabled()) {
   294   if (lt.is_enabled()) {
   296     ResourceMark rm;
   295     ResourceMark rm;
   297     LogStream ls(lt);
   296     LogStream ls(lt);
   298     log_phase(phase, 2, &ls, true);
   297     log_phase(phase, 2 + extra_indent, &ls, true);
   299   }
   298   }
   300 }
   299 }
   301 
   300 
   302 void G1GCPhaseTimes::trace_phase(WorkerDataArray<double>* phase, bool print_sum) const {
   301 void G1GCPhaseTimes::trace_phase(WorkerDataArray<double>* phase, bool print_sum) const {
   303   LogTarget(Trace, gc, phases) lt;
   302   LogTarget(Trace, gc, phases) lt;
   415                         _cur_strong_code_root_purge_time_ms +
   414                         _cur_strong_code_root_purge_time_ms +
   416                         _recorded_redirty_logged_cards_time_ms +
   415                         _recorded_redirty_logged_cards_time_ms +
   417                         _recorded_total_free_cset_time_ms +
   416                         _recorded_total_free_cset_time_ms +
   418                         _cur_fast_reclaim_humongous_time_ms +
   417                         _cur_fast_reclaim_humongous_time_ms +
   419                         _cur_expand_heap_time_ms +
   418                         _cur_expand_heap_time_ms +
   420                         _cur_string_dedup_fixup_time_ms;
   419                         _cur_string_deduplication_time_ms;
   421 
   420 
   422   info_time("Post Evacuate Collection Set", sum_ms);
   421   info_time("Post Evacuate Collection Set", sum_ms);
   423 
   422 
   424   debug_time("Code Roots Fixup", _cur_collection_code_root_fixup_time_ms);
   423   debug_time("Code Roots Fixup", _cur_collection_code_root_fixup_time_ms);
   425 
   424 
   428   debug_time_for_reference("Reference Processing", _cur_ref_proc_time_ms);
   427   debug_time_for_reference("Reference Processing", _cur_ref_proc_time_ms);
   429   _ref_phase_times.print_all_references(2, false);
   428   _ref_phase_times.print_all_references(2, false);
   430   _weak_phase_times.log_print(2);
   429   _weak_phase_times.log_print(2);
   431 
   430 
   432   if (G1StringDedup::is_enabled()) {
   431   if (G1StringDedup::is_enabled()) {
   433     debug_time("String Dedup Fixup", _cur_string_dedup_fixup_time_ms);
   432     debug_time("String Deduplication", _cur_string_deduplication_time_ms);
   434     debug_phase(_gc_par_phases[StringDedupQueueFixup]);
   433     debug_phase(_gc_par_phases[StringDedupQueueFixup], 1);
   435     debug_phase(_gc_par_phases[StringDedupTableFixup]);
   434     debug_phase(_gc_par_phases[StringDedupTableFixup], 1);
   436   }
   435   }
   437 
   436 
   438   if (G1CollectedHeap::heap()->evacuation_failed()) {
   437   if (G1CollectedHeap::heap()->evacuation_failed()) {
   439     debug_time("Evacuation Failure", evac_fail_handling);
   438     debug_time("Evacuation Failure", evac_fail_handling);
   440     trace_time("Recalculate Used", _cur_evac_fail_recalc_used);
   439     trace_time("Recalculate Used", _cur_evac_fail_recalc_used);
   495 const char* G1GCPhaseTimes::phase_name(GCParPhases phase) {
   494 const char* G1GCPhaseTimes::phase_name(GCParPhases phase) {
   496   static const char* names[] = {
   495   static const char* names[] = {
   497       "GCWorkerStart",
   496       "GCWorkerStart",
   498       "ExtRootScan",
   497       "ExtRootScan",
   499       "ThreadRoots",
   498       "ThreadRoots",
   500       "StringTableRoots",
       
   501       "UniverseRoots",
   499       "UniverseRoots",
   502       "JNIRoots",
   500       "JNIRoots",
   503       "ObjectSynchronizerRoots",
   501       "ObjectSynchronizerRoots",
   504       "ManagementRoots",
   502       "ManagementRoots",
   505       "SystemDictionaryRoots",
   503       "SystemDictionaryRoots",