src/hotspot/share/gc/g1/g1GCPhaseTimes.hpp
author tschatzl
Thu, 03 May 2018 14:09:00 +0200
changeset 49964 99e698e94cc7
parent 49911 358be4680d12
child 50049 9d17c375dc30
permissions -rw-r--r--
8201492: Properly implement non-contiguous generations for Reference discovery Summary: Collectors like G1 implementing non-contiguous generations previously used an inexact but conservative area for discovery. Concurrent and STW reference processing could discover the same reference multiple times, potentially missing referents during evacuation. So these collectors had to take extra measures while concurrent marking/reference discovery has been running. This change makes discovery exact for G1 (and any collector using non-contiguous generations) so that concurrent discovery and STW discovery discover on strictly disjoint memory areas. This means that the mentioned situation can not occur any more, and extra work is not required any more too. Reviewed-by: kbarrett, sjohanss
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13288
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
     1
/*
49911
358be4680d12 6672778: G1 should trim task queues more aggressively during evacuation pauses
tschatzl
parents: 49810
diff changeset
     2
 * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
13288
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
     4
 *
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
     7
 * published by the Free Software Foundation.
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
     8
 *
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
    13
 * accompanied this code).
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
    14
 *
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
    18
 *
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
    21
 * questions.
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
    22
 *
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
    23
 */
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
    24
30764
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 30578
diff changeset
    25
#ifndef SHARE_VM_GC_G1_G1GCPHASETIMES_HPP
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 30578
diff changeset
    26
#define SHARE_VM_GC_G1_G1GCPHASETIMES_HPP
13288
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
    27
46795
623a5e42deb6 8173335: Improve logging for j.l.ref.reference processing
sangheki
parents: 46778
diff changeset
    28
#include "gc/shared/referenceProcessorPhaseTimes.hpp"
42557
ee4c7799659d 8167679: G1 phase logging is messy
ehelin
parents: 42545
diff changeset
    29
#include "logging/logLevel.hpp"
13288
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
    30
#include "memory/allocation.hpp"
46681
f17cefd211b4 8183935: G1GCPhaseTimes and G1RootProcessor do not include macros.hpp
mgerdin
parents: 46670
diff changeset
    31
#include "utilities/macros.hpp"
13516
f7adc27fb367 7178363: G1: Remove the serial code for PrintGCDetails and make it a special case of the parallel code
brutisso
parents: 13289
diff changeset
    32
29680
e5203ed6d805 8074037: Refactor the G1GCPhaseTime logging to make it easier to add new phases
brutisso
parents: 28379
diff changeset
    33
class LineBuffer;
49911
358be4680d12 6672778: G1 should trim task queues more aggressively during evacuation pauses
tschatzl
parents: 49810
diff changeset
    34
class G1ParScanThreadState;
46795
623a5e42deb6 8173335: Improve logging for j.l.ref.reference processing
sangheki
parents: 46778
diff changeset
    35
class STWGCTimer;
13516
f7adc27fb367 7178363: G1: Remove the serial code for PrintGCDetails and make it a special case of the parallel code
brutisso
parents: 13289
diff changeset
    36
29680
e5203ed6d805 8074037: Refactor the G1GCPhaseTime logging to make it easier to add new phases
brutisso
parents: 28379
diff changeset
    37
template <class T> class WorkerDataArray;
13516
f7adc27fb367 7178363: G1: Remove the serial code for PrintGCDetails and make it a special case of the parallel code
brutisso
parents: 13289
diff changeset
    38
13289
jmasa
parents: 13288
diff changeset
    39
class G1GCPhaseTimes : public CHeapObj<mtGC> {
13288
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
    40
  uint _max_gc_threads;
35907
57bdb6243428 8148734: G1: Make G1GCPhaseTimes keep track of the start GC time
brutisso
parents: 35163
diff changeset
    41
  jlong _gc_start_counter;
57bdb6243428 8148734: G1: Make G1GCPhaseTimes keep track of the start GC time
brutisso
parents: 35163
diff changeset
    42
  double _gc_pause_time_ms;
13288
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
    43
29680
e5203ed6d805 8074037: Refactor the G1GCPhaseTime logging to make it easier to add new phases
brutisso
parents: 28379
diff changeset
    44
 public:
e5203ed6d805 8074037: Refactor the G1GCPhaseTime logging to make it easier to add new phases
brutisso
parents: 28379
diff changeset
    45
  enum GCParPhases {
e5203ed6d805 8074037: Refactor the G1GCPhaseTime logging to make it easier to add new phases
brutisso
parents: 28379
diff changeset
    46
    GCWorkerStart,
e5203ed6d805 8074037: Refactor the G1GCPhaseTime logging to make it easier to add new phases
brutisso
parents: 28379
diff changeset
    47
    ExtRootScan,
29694
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 29680
diff changeset
    48
    ThreadRoots,
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 29680
diff changeset
    49
    StringTableRoots,
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 29680
diff changeset
    50
    UniverseRoots,
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 29680
diff changeset
    51
    JNIRoots,
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 29680
diff changeset
    52
    ObjectSynchronizerRoots,
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 29680
diff changeset
    53
    ManagementRoots,
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 29680
diff changeset
    54
    SystemDictionaryRoots,
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 29680
diff changeset
    55
    CLDGRoots,
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 29680
diff changeset
    56
    JVMTIRoots,
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 29680
diff changeset
    57
    CMRefRoots,
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 29680
diff changeset
    58
    WaitForStrongCLD,
442c3305ba39 8027962: Per-phase timing measurements for strong roots processing
brutisso
parents: 29680
diff changeset
    59
    WeakCLDRoots,
29680
e5203ed6d805 8074037: Refactor the G1GCPhaseTime logging to make it easier to add new phases
brutisso
parents: 28379
diff changeset
    60
    SATBFiltering,
e5203ed6d805 8074037: Refactor the G1GCPhaseTime logging to make it easier to add new phases
brutisso
parents: 28379
diff changeset
    61
    UpdateRS,
33204
b8a3901ac5b3 8069330: Adjustment of concurrent refinement thresholds does not take hot card cache into account
tschatzl
parents: 30764
diff changeset
    62
    ScanHCC,
29680
e5203ed6d805 8074037: Refactor the G1GCPhaseTime logging to make it easier to add new phases
brutisso
parents: 28379
diff changeset
    63
    ScanRS,
e5203ed6d805 8074037: Refactor the G1GCPhaseTime logging to make it easier to add new phases
brutisso
parents: 28379
diff changeset
    64
    CodeRoots,
42650
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents: 42557
diff changeset
    65
#if INCLUDE_AOT
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents: 42557
diff changeset
    66
    AOTCodeRoots,
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents: 42557
diff changeset
    67
#endif
29680
e5203ed6d805 8074037: Refactor the G1GCPhaseTime logging to make it easier to add new phases
brutisso
parents: 28379
diff changeset
    68
    ObjCopy,
e5203ed6d805 8074037: Refactor the G1GCPhaseTime logging to make it easier to add new phases
brutisso
parents: 28379
diff changeset
    69
    Termination,
e5203ed6d805 8074037: Refactor the G1GCPhaseTime logging to make it easier to add new phases
brutisso
parents: 28379
diff changeset
    70
    Other,
e5203ed6d805 8074037: Refactor the G1GCPhaseTime logging to make it easier to add new phases
brutisso
parents: 28379
diff changeset
    71
    GCWorkerTotal,
e5203ed6d805 8074037: Refactor the G1GCPhaseTime logging to make it easier to add new phases
brutisso
parents: 28379
diff changeset
    72
    GCWorkerEnd,
e5203ed6d805 8074037: Refactor the G1GCPhaseTime logging to make it easier to add new phases
brutisso
parents: 28379
diff changeset
    73
    StringDedupQueueFixup,
e5203ed6d805 8074037: Refactor the G1GCPhaseTime logging to make it easier to add new phases
brutisso
parents: 28379
diff changeset
    74
    StringDedupTableFixup,
e5203ed6d805 8074037: Refactor the G1GCPhaseTime logging to make it easier to add new phases
brutisso
parents: 28379
diff changeset
    75
    RedirtyCards,
39979
b17e445924da 8034842: Parallelize the Free CSet phase in G1
tschatzl
parents: 37214
diff changeset
    76
    YoungFreeCSet,
b17e445924da 8034842: Parallelize the Free CSet phase in G1
tschatzl
parents: 37214
diff changeset
    77
    NonYoungFreeCSet,
29680
e5203ed6d805 8074037: Refactor the G1GCPhaseTime logging to make it easier to add new phases
brutisso
parents: 28379
diff changeset
    78
    GCParPhasesSentinel
e5203ed6d805 8074037: Refactor the G1GCPhaseTime logging to make it easier to add new phases
brutisso
parents: 28379
diff changeset
    79
  };
e5203ed6d805 8074037: Refactor the G1GCPhaseTime logging to make it easier to add new phases
brutisso
parents: 28379
diff changeset
    80
46571
c70b36f0730d 8178148: Log more detailed information about scan rs phase
tschatzl
parents: 46330
diff changeset
    81
  enum GCScanRSWorkItems {
46778
f504c6f2eea5 8183121: Add information about scanned and skipped cards during UpdateRS
tschatzl
parents: 46681
diff changeset
    82
    ScanRSScannedCards,
f504c6f2eea5 8183121: Add information about scanned and skipped cards during UpdateRS
tschatzl
parents: 46681
diff changeset
    83
    ScanRSClaimedCards,
f504c6f2eea5 8183121: Add information about scanned and skipped cards during UpdateRS
tschatzl
parents: 46681
diff changeset
    84
    ScanRSSkippedCards
f504c6f2eea5 8183121: Add information about scanned and skipped cards during UpdateRS
tschatzl
parents: 46681
diff changeset
    85
  };
f504c6f2eea5 8183121: Add information about scanned and skipped cards during UpdateRS
tschatzl
parents: 46681
diff changeset
    86
f504c6f2eea5 8183121: Add information about scanned and skipped cards during UpdateRS
tschatzl
parents: 46681
diff changeset
    87
  enum GCUpdateRSWorkItems {
f504c6f2eea5 8183121: Add information about scanned and skipped cards during UpdateRS
tschatzl
parents: 46681
diff changeset
    88
    UpdateRSProcessedBuffers,
f504c6f2eea5 8183121: Add information about scanned and skipped cards during UpdateRS
tschatzl
parents: 46681
diff changeset
    89
    UpdateRSScannedCards,
f504c6f2eea5 8183121: Add information about scanned and skipped cards during UpdateRS
tschatzl
parents: 46681
diff changeset
    90
    UpdateRSSkippedCards
46571
c70b36f0730d 8178148: Log more detailed information about scan rs phase
tschatzl
parents: 46330
diff changeset
    91
  };
c70b36f0730d 8178148: Log more detailed information about scan rs phase
tschatzl
parents: 46330
diff changeset
    92
29680
e5203ed6d805 8074037: Refactor the G1GCPhaseTime logging to make it easier to add new phases
brutisso
parents: 28379
diff changeset
    93
 private:
e5203ed6d805 8074037: Refactor the G1GCPhaseTime logging to make it easier to add new phases
brutisso
parents: 28379
diff changeset
    94
  // Markers for grouping the phases in the GCPhases enum above
e5203ed6d805 8074037: Refactor the G1GCPhaseTime logging to make it easier to add new phases
brutisso
parents: 28379
diff changeset
    95
  static const int GCMainParPhasesLast = GCWorkerEnd;
e5203ed6d805 8074037: Refactor the G1GCPhaseTime logging to make it easier to add new phases
brutisso
parents: 28379
diff changeset
    96
  static const int StringDedupPhasesFirst = StringDedupQueueFixup;
e5203ed6d805 8074037: Refactor the G1GCPhaseTime logging to make it easier to add new phases
brutisso
parents: 28379
diff changeset
    97
  static const int StringDedupPhasesLast = StringDedupTableFixup;
e5203ed6d805 8074037: Refactor the G1GCPhaseTime logging to make it easier to add new phases
brutisso
parents: 28379
diff changeset
    98
e5203ed6d805 8074037: Refactor the G1GCPhaseTime logging to make it easier to add new phases
brutisso
parents: 28379
diff changeset
    99
  WorkerDataArray<double>* _gc_par_phases[GCParPhasesSentinel];
46571
c70b36f0730d 8178148: Log more detailed information about scan rs phase
tschatzl
parents: 46330
diff changeset
   100
29680
e5203ed6d805 8074037: Refactor the G1GCPhaseTime logging to make it easier to add new phases
brutisso
parents: 28379
diff changeset
   101
  WorkerDataArray<size_t>* _update_rs_processed_buffers;
46778
f504c6f2eea5 8183121: Add information about scanned and skipped cards during UpdateRS
tschatzl
parents: 46681
diff changeset
   102
  WorkerDataArray<size_t>* _update_rs_scanned_cards;
f504c6f2eea5 8183121: Add information about scanned and skipped cards during UpdateRS
tschatzl
parents: 46681
diff changeset
   103
  WorkerDataArray<size_t>* _update_rs_skipped_cards;
46571
c70b36f0730d 8178148: Log more detailed information about scan rs phase
tschatzl
parents: 46330
diff changeset
   104
c70b36f0730d 8178148: Log more detailed information about scan rs phase
tschatzl
parents: 46330
diff changeset
   105
  WorkerDataArray<size_t>* _scan_rs_scanned_cards;
c70b36f0730d 8178148: Log more detailed information about scan rs phase
tschatzl
parents: 46330
diff changeset
   106
  WorkerDataArray<size_t>* _scan_rs_claimed_cards;
c70b36f0730d 8178148: Log more detailed information about scan rs phase
tschatzl
parents: 46330
diff changeset
   107
  WorkerDataArray<size_t>* _scan_rs_skipped_cards;
c70b36f0730d 8178148: Log more detailed information about scan rs phase
tschatzl
parents: 46330
diff changeset
   108
29680
e5203ed6d805 8074037: Refactor the G1GCPhaseTime logging to make it easier to add new phases
brutisso
parents: 28379
diff changeset
   109
  WorkerDataArray<size_t>* _termination_attempts;
46571
c70b36f0730d 8178148: Log more detailed information about scan rs phase
tschatzl
parents: 46330
diff changeset
   110
29680
e5203ed6d805 8074037: Refactor the G1GCPhaseTime logging to make it easier to add new phases
brutisso
parents: 28379
diff changeset
   111
  WorkerDataArray<size_t>* _redirtied_cards;
13288
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
   112
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
   113
  double _cur_collection_par_time_ms;
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
   114
  double _cur_collection_code_root_fixup_time_ms;
23451
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents: 19339
diff changeset
   115
  double _cur_strong_code_root_purge_time_ms;
13288
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
   116
23455
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
   117
  double _cur_evac_fail_recalc_used;
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
   118
  double _cur_evac_fail_remove_self_forwards;
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
   119
29680
e5203ed6d805 8074037: Refactor the G1GCPhaseTime logging to make it easier to add new phases
brutisso
parents: 28379
diff changeset
   120
  double _cur_string_dedup_fixup_time_ms;
23472
35e93890ed88 8029075: String deduplication in G1
pliden
parents: 23455
diff changeset
   121
46330
40e2718fac10 8155094: Add logging for long lasting methods found in JDK-8152948
tschatzl
parents: 42650
diff changeset
   122
  double _cur_prepare_tlab_time_ms;
40e2718fac10 8155094: Add logging for long lasting methods found in JDK-8152948
tschatzl
parents: 42650
diff changeset
   123
  double _cur_resize_tlab_time_ms;
40e2718fac10 8155094: Add logging for long lasting methods found in JDK-8152948
tschatzl
parents: 42650
diff changeset
   124
40e2718fac10 8155094: Add logging for long lasting methods found in JDK-8152948
tschatzl
parents: 42650
diff changeset
   125
  double _cur_derived_pointer_table_update_time_ms;
40e2718fac10 8155094: Add logging for long lasting methods found in JDK-8152948
tschatzl
parents: 42650
diff changeset
   126
13288
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
   127
  double _cur_clear_ct_time_ms;
33577
d6c1611973dc 8060017: G1: Report heap sizing time
ecaspole
parents: 33204
diff changeset
   128
  double _cur_expand_heap_time_ms;
13288
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
   129
  double _cur_ref_proc_time_ms;
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
   130
  double _cur_ref_enq_time_ms;
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
   131
49810
b5d5e53232ce 8201596: java.lang.ref.Reference processing total time logging broken
tschatzl
parents: 47216
diff changeset
   132
  double _cur_weak_ref_proc_time_ms;
b5d5e53232ce 8201596: java.lang.ref.Reference processing total time logging broken
tschatzl
parents: 47216
diff changeset
   133
13288
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
   134
  double _cur_collection_start_sec;
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
   135
  double _root_region_scan_wait_time_ms;
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
   136
34612
ed475e8089ef 8144145: G1GCPhaseTimes should allow externally accounted time
ehelin
parents: 33739
diff changeset
   137
  double _external_accounted_time_ms;
ed475e8089ef 8144145: G1GCPhaseTimes should allow externally accounted time
ehelin
parents: 33739
diff changeset
   138
42048
c1f066b53dd7 8160055: Misplaced call to ClassLoaderDataGraph::clear_claimed_marks during initial mark
jprovino
parents: 39979
diff changeset
   139
  double _recorded_clear_claimed_marks_time_ms;
c1f066b53dd7 8160055: Misplaced call to ClassLoaderDataGraph::clear_claimed_marks during initial mark
jprovino
parents: 39979
diff changeset
   140
13288
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
   141
  double _recorded_young_cset_choice_time_ms;
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
   142
  double _recorded_non_young_cset_choice_time_ms;
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
   143
23454
13a3b426f64d 8035398: Add card redirty time in "Other" time in G1
tschatzl
parents: 23451
diff changeset
   144
  double _recorded_redirty_logged_cards_time_ms;
13a3b426f64d 8035398: Add card redirty time in "Other" time in G1
tschatzl
parents: 23451
diff changeset
   145
36367
313c87c050f7 8076463: Add logging for the preserve CM referents task
tschatzl
parents: 35907
diff changeset
   146
  double _recorded_preserve_cm_referents_time_ms;
313c87c050f7 8076463: Add logging for the preserve CM referents task
tschatzl
parents: 35907
diff changeset
   147
36368
569d6e8072a9 8150630: Add logging for ParScanThreadState merge phase
tschatzl
parents: 36367
diff changeset
   148
  double _recorded_merge_pss_time_ms;
569d6e8072a9 8150630: Add logging for ParScanThreadState merge phase
tschatzl
parents: 36367
diff changeset
   149
46330
40e2718fac10 8155094: Add logging for long lasting methods found in JDK-8152948
tschatzl
parents: 42650
diff changeset
   150
  double _recorded_start_new_cset_time_ms;
40e2718fac10 8155094: Add logging for long lasting methods found in JDK-8152948
tschatzl
parents: 42650
diff changeset
   151
39979
b17e445924da 8034842: Parallelize the Free CSet phase in G1
tschatzl
parents: 37214
diff changeset
   152
  double _recorded_total_free_cset_time_ms;
b17e445924da 8034842: Parallelize the Free CSet phase in G1
tschatzl
parents: 37214
diff changeset
   153
b17e445924da 8034842: Parallelize the Free CSet phase in G1
tschatzl
parents: 37214
diff changeset
   154
  double _recorded_serial_free_cset_time_ms;
13288
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
   155
25889
221296ac4359 8027959: Early reclamation of large objects in G1
tschatzl
parents: 25492
diff changeset
   156
  double _cur_fast_reclaim_humongous_time_ms;
28379
e6784fc8fff2 8048179: Early reclaim of large objects that are referenced by a few objects
tschatzl
parents: 27880
diff changeset
   157
  double _cur_fast_reclaim_humongous_register_time_ms;
25889
221296ac4359 8027959: Early reclamation of large objects in G1
tschatzl
parents: 25492
diff changeset
   158
  size_t _cur_fast_reclaim_humongous_total;
221296ac4359 8027959: Early reclamation of large objects in G1
tschatzl
parents: 25492
diff changeset
   159
  size_t _cur_fast_reclaim_humongous_candidates;
221296ac4359 8027959: Early reclamation of large objects in G1
tschatzl
parents: 25492
diff changeset
   160
  size_t _cur_fast_reclaim_humongous_reclaimed;
221296ac4359 8027959: Early reclamation of large objects in G1
tschatzl
parents: 25492
diff changeset
   161
13516
f7adc27fb367 7178363: G1: Remove the serial code for PrintGCDetails and make it a special case of the parallel code
brutisso
parents: 13289
diff changeset
   162
  double _cur_verify_before_time_ms;
f7adc27fb367 7178363: G1: Remove the serial code for PrintGCDetails and make it a special case of the parallel code
brutisso
parents: 13289
diff changeset
   163
  double _cur_verify_after_time_ms;
f7adc27fb367 7178363: G1: Remove the serial code for PrintGCDetails and make it a special case of the parallel code
brutisso
parents: 13289
diff changeset
   164
46795
623a5e42deb6 8173335: Improve logging for j.l.ref.reference processing
sangheki
parents: 46778
diff changeset
   165
  ReferenceProcessorPhaseTimes _ref_phase_times;
623a5e42deb6 8173335: Improve logging for j.l.ref.reference processing
sangheki
parents: 46778
diff changeset
   166
37214
bc4e0e0995e6 8152952: Allow G1 phase logging to use individual number of threads
brutisso
parents: 36374
diff changeset
   167
  double worker_time(GCParPhases phase, uint worker);
36374
613f27cc37b9 8150068: Log the main G1 phases at info level
brutisso
parents: 36368
diff changeset
   168
  void note_gc_end();
42545
af9f4bf4d6d8 8168904: Initialize and reset G1 phase times to zero
ehelin
parents: 42048
diff changeset
   169
  void reset();
13288
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
   170
36374
613f27cc37b9 8150068: Log the main G1 phases at info level
brutisso
parents: 36368
diff changeset
   171
  template <class T>
42557
ee4c7799659d 8167679: G1 phase logging is messy
ehelin
parents: 42545
diff changeset
   172
  void details(T* phase, const char* indent) const;
ee4c7799659d 8167679: G1 phase logging is messy
ehelin
parents: 42545
diff changeset
   173
ee4c7799659d 8167679: G1 phase logging is messy
ehelin
parents: 42545
diff changeset
   174
  void log_phase(WorkerDataArray<double>* phase, uint indent, outputStream* out, bool print_sum) const;
ee4c7799659d 8167679: G1 phase logging is messy
ehelin
parents: 42545
diff changeset
   175
  void debug_phase(WorkerDataArray<double>* phase) const;
ee4c7799659d 8167679: G1 phase logging is messy
ehelin
parents: 42545
diff changeset
   176
  void trace_phase(WorkerDataArray<double>* phase, bool print_sum = true) const;
ee4c7799659d 8167679: G1 phase logging is messy
ehelin
parents: 42545
diff changeset
   177
ee4c7799659d 8167679: G1 phase logging is messy
ehelin
parents: 42545
diff changeset
   178
  void info_time(const char* name, double value) const;
ee4c7799659d 8167679: G1 phase logging is messy
ehelin
parents: 42545
diff changeset
   179
  void debug_time(const char* name, double value) const;
46795
623a5e42deb6 8173335: Improve logging for j.l.ref.reference processing
sangheki
parents: 46778
diff changeset
   180
  // This will print logs for both 'gc+phases' and 'gc+phases+ref'.
623a5e42deb6 8173335: Improve logging for j.l.ref.reference processing
sangheki
parents: 46778
diff changeset
   181
  void debug_time_for_reference(const char* name, double value) const;
42557
ee4c7799659d 8167679: G1 phase logging is messy
ehelin
parents: 42545
diff changeset
   182
  void trace_time(const char* name, double value) const;
ee4c7799659d 8167679: G1 phase logging is messy
ehelin
parents: 42545
diff changeset
   183
  void trace_count(const char* name, size_t value) const;
ee4c7799659d 8167679: G1 phase logging is messy
ehelin
parents: 42545
diff changeset
   184
ee4c7799659d 8167679: G1 phase logging is messy
ehelin
parents: 42545
diff changeset
   185
  double print_pre_evacuate_collection_set() const;
ee4c7799659d 8167679: G1 phase logging is messy
ehelin
parents: 42545
diff changeset
   186
  double print_evacuate_collection_set() const;
ee4c7799659d 8167679: G1 phase logging is messy
ehelin
parents: 42545
diff changeset
   187
  double print_post_evacuate_collection_set() const;
ee4c7799659d 8167679: G1 phase logging is messy
ehelin
parents: 42545
diff changeset
   188
  void print_other(double accounted_ms) const;
33738
1708291bd3d7 8140508: Add utility method for logging phases to G1CollectorPolicy
ehelin
parents: 33577
diff changeset
   189
13288
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
   190
 public:
46795
623a5e42deb6 8173335: Improve logging for j.l.ref.reference processing
sangheki
parents: 46778
diff changeset
   191
  G1GCPhaseTimes(STWGCTimer* gc_timer, uint max_gc_threads);
37214
bc4e0e0995e6 8152952: Allow G1 phase logging to use individual number of threads
brutisso
parents: 36374
diff changeset
   192
  void note_gc_start();
35907
57bdb6243428 8148734: G1: Make G1GCPhaseTimes keep track of the start GC time
brutisso
parents: 35163
diff changeset
   193
  void print();
13288
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
   194
29680
e5203ed6d805 8074037: Refactor the G1GCPhaseTime logging to make it easier to add new phases
brutisso
parents: 28379
diff changeset
   195
  // record the time a phase took in seconds
e5203ed6d805 8074037: Refactor the G1GCPhaseTime logging to make it easier to add new phases
brutisso
parents: 28379
diff changeset
   196
  void record_time_secs(GCParPhases phase, uint worker_i, double secs);
13288
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
   197
29680
e5203ed6d805 8074037: Refactor the G1GCPhaseTime logging to make it easier to add new phases
brutisso
parents: 28379
diff changeset
   198
  // add a number of seconds to a phase
e5203ed6d805 8074037: Refactor the G1GCPhaseTime logging to make it easier to add new phases
brutisso
parents: 28379
diff changeset
   199
  void add_time_secs(GCParPhases phase, uint worker_i, double secs);
13288
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
   200
49911
358be4680d12 6672778: G1 should trim task queues more aggressively during evacuation pauses
tschatzl
parents: 49810
diff changeset
   201
  void record_or_add_objcopy_time_secs(uint worker_i, double secs);
358be4680d12 6672778: G1 should trim task queues more aggressively during evacuation pauses
tschatzl
parents: 49810
diff changeset
   202
46571
c70b36f0730d 8178148: Log more detailed information about scan rs phase
tschatzl
parents: 46330
diff changeset
   203
  void record_thread_work_item(GCParPhases phase, uint worker_i, size_t count, uint index = 0);
13288
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
   204
29680
e5203ed6d805 8074037: Refactor the G1GCPhaseTime logging to make it easier to add new phases
brutisso
parents: 28379
diff changeset
   205
  // return the average time for a phase in milliseconds
e5203ed6d805 8074037: Refactor the G1GCPhaseTime logging to make it easier to add new phases
brutisso
parents: 28379
diff changeset
   206
  double average_time_ms(GCParPhases phase);
13288
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
   207
46571
c70b36f0730d 8178148: Log more detailed information about scan rs phase
tschatzl
parents: 46330
diff changeset
   208
  size_t sum_thread_work_items(GCParPhases phase, uint index = 0);
13516
f7adc27fb367 7178363: G1: Remove the serial code for PrintGCDetails and make it a special case of the parallel code
brutisso
parents: 13289
diff changeset
   209
29680
e5203ed6d805 8074037: Refactor the G1GCPhaseTime logging to make it easier to add new phases
brutisso
parents: 28379
diff changeset
   210
 public:
13288
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
   211
46330
40e2718fac10 8155094: Add logging for long lasting methods found in JDK-8152948
tschatzl
parents: 42650
diff changeset
   212
  void record_prepare_tlab_time_ms(double ms) {
40e2718fac10 8155094: Add logging for long lasting methods found in JDK-8152948
tschatzl
parents: 42650
diff changeset
   213
    _cur_prepare_tlab_time_ms = ms;
40e2718fac10 8155094: Add logging for long lasting methods found in JDK-8152948
tschatzl
parents: 42650
diff changeset
   214
  }
40e2718fac10 8155094: Add logging for long lasting methods found in JDK-8152948
tschatzl
parents: 42650
diff changeset
   215
40e2718fac10 8155094: Add logging for long lasting methods found in JDK-8152948
tschatzl
parents: 42650
diff changeset
   216
  void record_resize_tlab_time_ms(double ms) {
40e2718fac10 8155094: Add logging for long lasting methods found in JDK-8152948
tschatzl
parents: 42650
diff changeset
   217
    _cur_resize_tlab_time_ms = ms;
40e2718fac10 8155094: Add logging for long lasting methods found in JDK-8152948
tschatzl
parents: 42650
diff changeset
   218
  }
40e2718fac10 8155094: Add logging for long lasting methods found in JDK-8152948
tschatzl
parents: 42650
diff changeset
   219
40e2718fac10 8155094: Add logging for long lasting methods found in JDK-8152948
tschatzl
parents: 42650
diff changeset
   220
  void record_derived_pointer_table_update_time(double ms) {
40e2718fac10 8155094: Add logging for long lasting methods found in JDK-8152948
tschatzl
parents: 42650
diff changeset
   221
    _cur_derived_pointer_table_update_time_ms = ms;
40e2718fac10 8155094: Add logging for long lasting methods found in JDK-8152948
tschatzl
parents: 42650
diff changeset
   222
  }
40e2718fac10 8155094: Add logging for long lasting methods found in JDK-8152948
tschatzl
parents: 42650
diff changeset
   223
13288
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
   224
  void record_clear_ct_time(double ms) {
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
   225
    _cur_clear_ct_time_ms = ms;
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
   226
  }
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
   227
33577
d6c1611973dc 8060017: G1: Report heap sizing time
ecaspole
parents: 33204
diff changeset
   228
  void record_expand_heap_time(double ms) {
d6c1611973dc 8060017: G1: Report heap sizing time
ecaspole
parents: 33204
diff changeset
   229
    _cur_expand_heap_time_ms = ms;
d6c1611973dc 8060017: G1: Report heap sizing time
ecaspole
parents: 33204
diff changeset
   230
  }
d6c1611973dc 8060017: G1: Report heap sizing time
ecaspole
parents: 33204
diff changeset
   231
13288
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
   232
  void record_par_time(double ms) {
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
   233
    _cur_collection_par_time_ms = ms;
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
   234
  }
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
   235
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
   236
  void record_code_root_fixup_time(double ms) {
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
   237
    _cur_collection_code_root_fixup_time_ms = ms;
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
   238
  }
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
   239
23451
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents: 19339
diff changeset
   240
  void record_strong_code_root_purge_time(double ms) {
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents: 19339
diff changeset
   241
    _cur_strong_code_root_purge_time_ms = ms;
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents: 19339
diff changeset
   242
  }
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents: 19339
diff changeset
   243
23455
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
   244
  void record_evac_fail_recalc_used_time(double ms) {
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
   245
    _cur_evac_fail_recalc_used = ms;
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
   246
  }
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
   247
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
   248
  void record_evac_fail_remove_self_forwards(double ms) {
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
   249
    _cur_evac_fail_remove_self_forwards = ms;
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
   250
  }
e541bff96524 8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents: 23454
diff changeset
   251
23472
35e93890ed88 8029075: String deduplication in G1
pliden
parents: 23455
diff changeset
   252
  void record_string_dedup_fixup_time(double ms) {
35e93890ed88 8029075: String deduplication in G1
pliden
parents: 23455
diff changeset
   253
    _cur_string_dedup_fixup_time_ms = ms;
35e93890ed88 8029075: String deduplication in G1
pliden
parents: 23455
diff changeset
   254
  }
35e93890ed88 8029075: String deduplication in G1
pliden
parents: 23455
diff changeset
   255
13288
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
   256
  void record_ref_proc_time(double ms) {
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
   257
    _cur_ref_proc_time_ms = ms;
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
   258
  }
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
   259
49810
b5d5e53232ce 8201596: java.lang.ref.Reference processing total time logging broken
tschatzl
parents: 47216
diff changeset
   260
  void record_weak_ref_proc_time(double ms) {
b5d5e53232ce 8201596: java.lang.ref.Reference processing total time logging broken
tschatzl
parents: 47216
diff changeset
   261
    _cur_weak_ref_proc_time_ms = ms;
b5d5e53232ce 8201596: java.lang.ref.Reference processing total time logging broken
tschatzl
parents: 47216
diff changeset
   262
  }
b5d5e53232ce 8201596: java.lang.ref.Reference processing total time logging broken
tschatzl
parents: 47216
diff changeset
   263
13288
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
   264
  void record_ref_enq_time(double ms) {
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
   265
    _cur_ref_enq_time_ms = ms;
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
   266
  }
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
   267
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
   268
  void record_root_region_scan_wait_time(double time_ms) {
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
   269
    _root_region_scan_wait_time_ms = time_ms;
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
   270
  }
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
   271
39979
b17e445924da 8034842: Parallelize the Free CSet phase in G1
tschatzl
parents: 37214
diff changeset
   272
  void record_total_free_cset_time_ms(double time_ms) {
b17e445924da 8034842: Parallelize the Free CSet phase in G1
tschatzl
parents: 37214
diff changeset
   273
    _recorded_total_free_cset_time_ms = time_ms;
13288
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
   274
  }
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
   275
39979
b17e445924da 8034842: Parallelize the Free CSet phase in G1
tschatzl
parents: 37214
diff changeset
   276
  void record_serial_free_cset_time_ms(double time_ms) {
b17e445924da 8034842: Parallelize the Free CSet phase in G1
tschatzl
parents: 37214
diff changeset
   277
    _recorded_serial_free_cset_time_ms = time_ms;
13288
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
   278
  }
13516
f7adc27fb367 7178363: G1: Remove the serial code for PrintGCDetails and make it a special case of the parallel code
brutisso
parents: 13289
diff changeset
   279
28379
e6784fc8fff2 8048179: Early reclaim of large objects that are referenced by a few objects
tschatzl
parents: 27880
diff changeset
   280
  void record_fast_reclaim_humongous_stats(double time_ms, size_t total, size_t candidates) {
e6784fc8fff2 8048179: Early reclaim of large objects that are referenced by a few objects
tschatzl
parents: 27880
diff changeset
   281
    _cur_fast_reclaim_humongous_register_time_ms = time_ms;
25889
221296ac4359 8027959: Early reclamation of large objects in G1
tschatzl
parents: 25492
diff changeset
   282
    _cur_fast_reclaim_humongous_total = total;
221296ac4359 8027959: Early reclamation of large objects in G1
tschatzl
parents: 25492
diff changeset
   283
    _cur_fast_reclaim_humongous_candidates = candidates;
221296ac4359 8027959: Early reclamation of large objects in G1
tschatzl
parents: 25492
diff changeset
   284
  }
221296ac4359 8027959: Early reclamation of large objects in G1
tschatzl
parents: 25492
diff changeset
   285
221296ac4359 8027959: Early reclamation of large objects in G1
tschatzl
parents: 25492
diff changeset
   286
  void record_fast_reclaim_humongous_time_ms(double value, size_t reclaimed) {
221296ac4359 8027959: Early reclamation of large objects in G1
tschatzl
parents: 25492
diff changeset
   287
    _cur_fast_reclaim_humongous_time_ms = value;
221296ac4359 8027959: Early reclamation of large objects in G1
tschatzl
parents: 25492
diff changeset
   288
    _cur_fast_reclaim_humongous_reclaimed = reclaimed;
221296ac4359 8027959: Early reclamation of large objects in G1
tschatzl
parents: 25492
diff changeset
   289
  }
221296ac4359 8027959: Early reclamation of large objects in G1
tschatzl
parents: 25492
diff changeset
   290
13516
f7adc27fb367 7178363: G1: Remove the serial code for PrintGCDetails and make it a special case of the parallel code
brutisso
parents: 13289
diff changeset
   291
  void record_young_cset_choice_time_ms(double time_ms) {
f7adc27fb367 7178363: G1: Remove the serial code for PrintGCDetails and make it a special case of the parallel code
brutisso
parents: 13289
diff changeset
   292
    _recorded_young_cset_choice_time_ms = time_ms;
f7adc27fb367 7178363: G1: Remove the serial code for PrintGCDetails and make it a special case of the parallel code
brutisso
parents: 13289
diff changeset
   293
  }
f7adc27fb367 7178363: G1: Remove the serial code for PrintGCDetails and make it a special case of the parallel code
brutisso
parents: 13289
diff changeset
   294
f7adc27fb367 7178363: G1: Remove the serial code for PrintGCDetails and make it a special case of the parallel code
brutisso
parents: 13289
diff changeset
   295
  void record_non_young_cset_choice_time_ms(double time_ms) {
f7adc27fb367 7178363: G1: Remove the serial code for PrintGCDetails and make it a special case of the parallel code
brutisso
parents: 13289
diff changeset
   296
    _recorded_non_young_cset_choice_time_ms = time_ms;
f7adc27fb367 7178363: G1: Remove the serial code for PrintGCDetails and make it a special case of the parallel code
brutisso
parents: 13289
diff changeset
   297
  }
f7adc27fb367 7178363: G1: Remove the serial code for PrintGCDetails and make it a special case of the parallel code
brutisso
parents: 13289
diff changeset
   298
23454
13a3b426f64d 8035398: Add card redirty time in "Other" time in G1
tschatzl
parents: 23451
diff changeset
   299
  void record_redirty_logged_cards_time_ms(double time_ms) {
13a3b426f64d 8035398: Add card redirty time in "Other" time in G1
tschatzl
parents: 23451
diff changeset
   300
    _recorded_redirty_logged_cards_time_ms = time_ms;
13a3b426f64d 8035398: Add card redirty time in "Other" time in G1
tschatzl
parents: 23451
diff changeset
   301
  }
13a3b426f64d 8035398: Add card redirty time in "Other" time in G1
tschatzl
parents: 23451
diff changeset
   302
36367
313c87c050f7 8076463: Add logging for the preserve CM referents task
tschatzl
parents: 35907
diff changeset
   303
  void record_preserve_cm_referents_time_ms(double time_ms) {
313c87c050f7 8076463: Add logging for the preserve CM referents task
tschatzl
parents: 35907
diff changeset
   304
    _recorded_preserve_cm_referents_time_ms = time_ms;
313c87c050f7 8076463: Add logging for the preserve CM referents task
tschatzl
parents: 35907
diff changeset
   305
  }
313c87c050f7 8076463: Add logging for the preserve CM referents task
tschatzl
parents: 35907
diff changeset
   306
36368
569d6e8072a9 8150630: Add logging for ParScanThreadState merge phase
tschatzl
parents: 36367
diff changeset
   307
  void record_merge_pss_time_ms(double time_ms) {
569d6e8072a9 8150630: Add logging for ParScanThreadState merge phase
tschatzl
parents: 36367
diff changeset
   308
    _recorded_merge_pss_time_ms = time_ms;
569d6e8072a9 8150630: Add logging for ParScanThreadState merge phase
tschatzl
parents: 36367
diff changeset
   309
  }
569d6e8072a9 8150630: Add logging for ParScanThreadState merge phase
tschatzl
parents: 36367
diff changeset
   310
46330
40e2718fac10 8155094: Add logging for long lasting methods found in JDK-8152948
tschatzl
parents: 42650
diff changeset
   311
  void record_start_new_cset_time_ms(double time_ms) {
40e2718fac10 8155094: Add logging for long lasting methods found in JDK-8152948
tschatzl
parents: 42650
diff changeset
   312
    _recorded_start_new_cset_time_ms = time_ms;
40e2718fac10 8155094: Add logging for long lasting methods found in JDK-8152948
tschatzl
parents: 42650
diff changeset
   313
  }
40e2718fac10 8155094: Add logging for long lasting methods found in JDK-8152948
tschatzl
parents: 42650
diff changeset
   314
13516
f7adc27fb367 7178363: G1: Remove the serial code for PrintGCDetails and make it a special case of the parallel code
brutisso
parents: 13289
diff changeset
   315
  void record_cur_collection_start_sec(double time_ms) {
f7adc27fb367 7178363: G1: Remove the serial code for PrintGCDetails and make it a special case of the parallel code
brutisso
parents: 13289
diff changeset
   316
    _cur_collection_start_sec = time_ms;
f7adc27fb367 7178363: G1: Remove the serial code for PrintGCDetails and make it a special case of the parallel code
brutisso
parents: 13289
diff changeset
   317
  }
f7adc27fb367 7178363: G1: Remove the serial code for PrintGCDetails and make it a special case of the parallel code
brutisso
parents: 13289
diff changeset
   318
f7adc27fb367 7178363: G1: Remove the serial code for PrintGCDetails and make it a special case of the parallel code
brutisso
parents: 13289
diff changeset
   319
  void record_verify_before_time_ms(double time_ms) {
f7adc27fb367 7178363: G1: Remove the serial code for PrintGCDetails and make it a special case of the parallel code
brutisso
parents: 13289
diff changeset
   320
    _cur_verify_before_time_ms = time_ms;
f7adc27fb367 7178363: G1: Remove the serial code for PrintGCDetails and make it a special case of the parallel code
brutisso
parents: 13289
diff changeset
   321
  }
f7adc27fb367 7178363: G1: Remove the serial code for PrintGCDetails and make it a special case of the parallel code
brutisso
parents: 13289
diff changeset
   322
f7adc27fb367 7178363: G1: Remove the serial code for PrintGCDetails and make it a special case of the parallel code
brutisso
parents: 13289
diff changeset
   323
  void record_verify_after_time_ms(double time_ms) {
f7adc27fb367 7178363: G1: Remove the serial code for PrintGCDetails and make it a special case of the parallel code
brutisso
parents: 13289
diff changeset
   324
    _cur_verify_after_time_ms = time_ms;
f7adc27fb367 7178363: G1: Remove the serial code for PrintGCDetails and make it a special case of the parallel code
brutisso
parents: 13289
diff changeset
   325
  }
f7adc27fb367 7178363: G1: Remove the serial code for PrintGCDetails and make it a special case of the parallel code
brutisso
parents: 13289
diff changeset
   326
34612
ed475e8089ef 8144145: G1GCPhaseTimes should allow externally accounted time
ehelin
parents: 33739
diff changeset
   327
  void inc_external_accounted_time_ms(double time_ms) {
ed475e8089ef 8144145: G1GCPhaseTimes should allow externally accounted time
ehelin
parents: 33739
diff changeset
   328
    _external_accounted_time_ms += time_ms;
ed475e8089ef 8144145: G1GCPhaseTimes should allow externally accounted time
ehelin
parents: 33739
diff changeset
   329
  }
ed475e8089ef 8144145: G1GCPhaseTimes should allow externally accounted time
ehelin
parents: 33739
diff changeset
   330
42048
c1f066b53dd7 8160055: Misplaced call to ClassLoaderDataGraph::clear_claimed_marks during initial mark
jprovino
parents: 39979
diff changeset
   331
  void record_clear_claimed_marks_time_ms(double recorded_clear_claimed_marks_time_ms) {
c1f066b53dd7 8160055: Misplaced call to ClassLoaderDataGraph::clear_claimed_marks during initial mark
jprovino
parents: 39979
diff changeset
   332
    _recorded_clear_claimed_marks_time_ms = recorded_clear_claimed_marks_time_ms;
c1f066b53dd7 8160055: Misplaced call to ClassLoaderDataGraph::clear_claimed_marks during initial mark
jprovino
parents: 39979
diff changeset
   333
  }
c1f066b53dd7 8160055: Misplaced call to ClassLoaderDataGraph::clear_claimed_marks during initial mark
jprovino
parents: 39979
diff changeset
   334
13516
f7adc27fb367 7178363: G1: Remove the serial code for PrintGCDetails and make it a special case of the parallel code
brutisso
parents: 13289
diff changeset
   335
  double cur_collection_start_sec() {
f7adc27fb367 7178363: G1: Remove the serial code for PrintGCDetails and make it a special case of the parallel code
brutisso
parents: 13289
diff changeset
   336
    return _cur_collection_start_sec;
f7adc27fb367 7178363: G1: Remove the serial code for PrintGCDetails and make it a special case of the parallel code
brutisso
parents: 13289
diff changeset
   337
  }
f7adc27fb367 7178363: G1: Remove the serial code for PrintGCDetails and make it a special case of the parallel code
brutisso
parents: 13289
diff changeset
   338
f7adc27fb367 7178363: G1: Remove the serial code for PrintGCDetails and make it a special case of the parallel code
brutisso
parents: 13289
diff changeset
   339
  double cur_collection_par_time_ms() {
f7adc27fb367 7178363: G1: Remove the serial code for PrintGCDetails and make it a special case of the parallel code
brutisso
parents: 13289
diff changeset
   340
    return _cur_collection_par_time_ms;
f7adc27fb367 7178363: G1: Remove the serial code for PrintGCDetails and make it a special case of the parallel code
brutisso
parents: 13289
diff changeset
   341
  }
f7adc27fb367 7178363: G1: Remove the serial code for PrintGCDetails and make it a special case of the parallel code
brutisso
parents: 13289
diff changeset
   342
f7adc27fb367 7178363: G1: Remove the serial code for PrintGCDetails and make it a special case of the parallel code
brutisso
parents: 13289
diff changeset
   343
  double cur_clear_ct_time_ms() {
f7adc27fb367 7178363: G1: Remove the serial code for PrintGCDetails and make it a special case of the parallel code
brutisso
parents: 13289
diff changeset
   344
    return _cur_clear_ct_time_ms;
f7adc27fb367 7178363: G1: Remove the serial code for PrintGCDetails and make it a special case of the parallel code
brutisso
parents: 13289
diff changeset
   345
  }
f7adc27fb367 7178363: G1: Remove the serial code for PrintGCDetails and make it a special case of the parallel code
brutisso
parents: 13289
diff changeset
   346
33577
d6c1611973dc 8060017: G1: Report heap sizing time
ecaspole
parents: 33204
diff changeset
   347
  double cur_expand_heap_time_ms() {
d6c1611973dc 8060017: G1: Report heap sizing time
ecaspole
parents: 33204
diff changeset
   348
    return _cur_expand_heap_time_ms;
d6c1611973dc 8060017: G1: Report heap sizing time
ecaspole
parents: 33204
diff changeset
   349
  }
d6c1611973dc 8060017: G1: Report heap sizing time
ecaspole
parents: 33204
diff changeset
   350
13516
f7adc27fb367 7178363: G1: Remove the serial code for PrintGCDetails and make it a special case of the parallel code
brutisso
parents: 13289
diff changeset
   351
  double root_region_scan_wait_time_ms() {
f7adc27fb367 7178363: G1: Remove the serial code for PrintGCDetails and make it a special case of the parallel code
brutisso
parents: 13289
diff changeset
   352
    return _root_region_scan_wait_time_ms;
f7adc27fb367 7178363: G1: Remove the serial code for PrintGCDetails and make it a special case of the parallel code
brutisso
parents: 13289
diff changeset
   353
  }
f7adc27fb367 7178363: G1: Remove the serial code for PrintGCDetails and make it a special case of the parallel code
brutisso
parents: 13289
diff changeset
   354
f7adc27fb367 7178363: G1: Remove the serial code for PrintGCDetails and make it a special case of the parallel code
brutisso
parents: 13289
diff changeset
   355
  double young_cset_choice_time_ms() {
f7adc27fb367 7178363: G1: Remove the serial code for PrintGCDetails and make it a special case of the parallel code
brutisso
parents: 13289
diff changeset
   356
    return _recorded_young_cset_choice_time_ms;
f7adc27fb367 7178363: G1: Remove the serial code for PrintGCDetails and make it a special case of the parallel code
brutisso
parents: 13289
diff changeset
   357
  }
f7adc27fb367 7178363: G1: Remove the serial code for PrintGCDetails and make it a special case of the parallel code
brutisso
parents: 13289
diff changeset
   358
39979
b17e445924da 8034842: Parallelize the Free CSet phase in G1
tschatzl
parents: 37214
diff changeset
   359
  double total_free_cset_time_ms() {
b17e445924da 8034842: Parallelize the Free CSet phase in G1
tschatzl
parents: 37214
diff changeset
   360
    return _recorded_total_free_cset_time_ms;
13516
f7adc27fb367 7178363: G1: Remove the serial code for PrintGCDetails and make it a special case of the parallel code
brutisso
parents: 13289
diff changeset
   361
  }
f7adc27fb367 7178363: G1: Remove the serial code for PrintGCDetails and make it a special case of the parallel code
brutisso
parents: 13289
diff changeset
   362
f7adc27fb367 7178363: G1: Remove the serial code for PrintGCDetails and make it a special case of the parallel code
brutisso
parents: 13289
diff changeset
   363
  double non_young_cset_choice_time_ms() {
f7adc27fb367 7178363: G1: Remove the serial code for PrintGCDetails and make it a special case of the parallel code
brutisso
parents: 13289
diff changeset
   364
    return _recorded_non_young_cset_choice_time_ms;
f7adc27fb367 7178363: G1: Remove the serial code for PrintGCDetails and make it a special case of the parallel code
brutisso
parents: 13289
diff changeset
   365
  }
f7adc27fb367 7178363: G1: Remove the serial code for PrintGCDetails and make it a special case of the parallel code
brutisso
parents: 13289
diff changeset
   366
25889
221296ac4359 8027959: Early reclamation of large objects in G1
tschatzl
parents: 25492
diff changeset
   367
  double fast_reclaim_humongous_time_ms() {
221296ac4359 8027959: Early reclamation of large objects in G1
tschatzl
parents: 25492
diff changeset
   368
    return _cur_fast_reclaim_humongous_time_ms;
221296ac4359 8027959: Early reclamation of large objects in G1
tschatzl
parents: 25492
diff changeset
   369
  }
46795
623a5e42deb6 8173335: Improve logging for j.l.ref.reference processing
sangheki
parents: 46778
diff changeset
   370
623a5e42deb6 8173335: Improve logging for j.l.ref.reference processing
sangheki
parents: 46778
diff changeset
   371
  ReferenceProcessorPhaseTimes* ref_phase_times() { return &_ref_phase_times; }
29680
e5203ed6d805 8074037: Refactor the G1GCPhaseTime logging to make it easier to add new phases
brutisso
parents: 28379
diff changeset
   372
};
13516
f7adc27fb367 7178363: G1: Remove the serial code for PrintGCDetails and make it a special case of the parallel code
brutisso
parents: 13289
diff changeset
   373
49911
358be4680d12 6672778: G1 should trim task queues more aggressively during evacuation pauses
tschatzl
parents: 49810
diff changeset
   374
class G1EvacPhaseWithTrimTimeTracker : public StackObj {
358be4680d12 6672778: G1 should trim task queues more aggressively during evacuation pauses
tschatzl
parents: 49810
diff changeset
   375
  G1ParScanThreadState* _pss;
358be4680d12 6672778: G1 should trim task queues more aggressively during evacuation pauses
tschatzl
parents: 49810
diff changeset
   376
  Ticks _start;
358be4680d12 6672778: G1 should trim task queues more aggressively during evacuation pauses
tschatzl
parents: 49810
diff changeset
   377
358be4680d12 6672778: G1 should trim task queues more aggressively during evacuation pauses
tschatzl
parents: 49810
diff changeset
   378
  Tickspan& _total_time;
358be4680d12 6672778: G1 should trim task queues more aggressively during evacuation pauses
tschatzl
parents: 49810
diff changeset
   379
  Tickspan& _trim_time;
358be4680d12 6672778: G1 should trim task queues more aggressively during evacuation pauses
tschatzl
parents: 49810
diff changeset
   380
public:
358be4680d12 6672778: G1 should trim task queues more aggressively during evacuation pauses
tschatzl
parents: 49810
diff changeset
   381
  G1EvacPhaseWithTrimTimeTracker(G1ParScanThreadState* pss, Tickspan& total_time, Tickspan& trim_time);
358be4680d12 6672778: G1 should trim task queues more aggressively during evacuation pauses
tschatzl
parents: 49810
diff changeset
   382
  ~G1EvacPhaseWithTrimTimeTracker();
358be4680d12 6672778: G1 should trim task queues more aggressively during evacuation pauses
tschatzl
parents: 49810
diff changeset
   383
};
358be4680d12 6672778: G1 should trim task queues more aggressively during evacuation pauses
tschatzl
parents: 49810
diff changeset
   384
358be4680d12 6672778: G1 should trim task queues more aggressively during evacuation pauses
tschatzl
parents: 49810
diff changeset
   385
class G1GCParPhaseTimesTracker : public CHeapObj<mtGC> {
358be4680d12 6672778: G1 should trim task queues more aggressively during evacuation pauses
tschatzl
parents: 49810
diff changeset
   386
protected:
358be4680d12 6672778: G1 should trim task queues more aggressively during evacuation pauses
tschatzl
parents: 49810
diff changeset
   387
  Ticks _start_time;
29680
e5203ed6d805 8074037: Refactor the G1GCPhaseTime logging to make it easier to add new phases
brutisso
parents: 28379
diff changeset
   388
  G1GCPhaseTimes::GCParPhases _phase;
e5203ed6d805 8074037: Refactor the G1GCPhaseTime logging to make it easier to add new phases
brutisso
parents: 28379
diff changeset
   389
  G1GCPhaseTimes* _phase_times;
e5203ed6d805 8074037: Refactor the G1GCPhaseTime logging to make it easier to add new phases
brutisso
parents: 28379
diff changeset
   390
  uint _worker_id;
e5203ed6d805 8074037: Refactor the G1GCPhaseTime logging to make it easier to add new phases
brutisso
parents: 28379
diff changeset
   391
public:
e5203ed6d805 8074037: Refactor the G1GCPhaseTime logging to make it easier to add new phases
brutisso
parents: 28379
diff changeset
   392
  G1GCParPhaseTimesTracker(G1GCPhaseTimes* phase_times, G1GCPhaseTimes::GCParPhases phase, uint worker_id);
49911
358be4680d12 6672778: G1 should trim task queues more aggressively during evacuation pauses
tschatzl
parents: 49810
diff changeset
   393
  virtual ~G1GCParPhaseTimesTracker();
358be4680d12 6672778: G1 should trim task queues more aggressively during evacuation pauses
tschatzl
parents: 49810
diff changeset
   394
};
358be4680d12 6672778: G1 should trim task queues more aggressively during evacuation pauses
tschatzl
parents: 49810
diff changeset
   395
358be4680d12 6672778: G1 should trim task queues more aggressively during evacuation pauses
tschatzl
parents: 49810
diff changeset
   396
class G1EvacPhaseTimesTracker : public G1GCParPhaseTimesTracker {
358be4680d12 6672778: G1 should trim task queues more aggressively during evacuation pauses
tschatzl
parents: 49810
diff changeset
   397
  Tickspan _total_time;
358be4680d12 6672778: G1 should trim task queues more aggressively during evacuation pauses
tschatzl
parents: 49810
diff changeset
   398
  Tickspan _trim_time;
358be4680d12 6672778: G1 should trim task queues more aggressively during evacuation pauses
tschatzl
parents: 49810
diff changeset
   399
358be4680d12 6672778: G1 should trim task queues more aggressively during evacuation pauses
tschatzl
parents: 49810
diff changeset
   400
  G1EvacPhaseWithTrimTimeTracker _trim_tracker;
358be4680d12 6672778: G1 should trim task queues more aggressively during evacuation pauses
tschatzl
parents: 49810
diff changeset
   401
public:
358be4680d12 6672778: G1 should trim task queues more aggressively during evacuation pauses
tschatzl
parents: 49810
diff changeset
   402
  G1EvacPhaseTimesTracker(G1GCPhaseTimes* phase_times, G1ParScanThreadState* pss, G1GCPhaseTimes::GCParPhases phase, uint worker_id);
358be4680d12 6672778: G1 should trim task queues more aggressively during evacuation pauses
tschatzl
parents: 49810
diff changeset
   403
  virtual ~G1EvacPhaseTimesTracker();
13288
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
   404
};
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
diff changeset
   405
30764
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 30578
diff changeset
   406
#endif // SHARE_VM_GC_G1_G1GCPHASETIMES_HPP