src/hotspot/share/gc/g1/g1Policy.hpp
author erikj
Tue, 12 Sep 2017 19:03:39 +0200
changeset 47216 71c04702a3d5
parent 41284 hotspot/src/share/vm/gc/g1/g1Policy.hpp@b4276ec89d0d
child 47681 149745044e48
permissions -rw-r--r--
8187443: Forest Consolidation: Move files to unified layout Reviewed-by: darcy, ihse
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents:
diff changeset
     1
/*
37985
539c597ee0fa 8154154: Separate G1 specific policy code from the CollectorPolicy class hierarchy
mgerdin
parents: 37262
diff changeset
     2
 * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents:
diff changeset
     4
 *
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents:
diff changeset
     7
 * published by the Free Software Foundation.
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents:
diff changeset
     8
 *
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents:
diff changeset
    13
 * accompanied this code).
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents:
diff changeset
    14
 *
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents:
diff changeset
    18
 *
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5350
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5350
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5350
diff changeset
    21
 * questions.
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents:
diff changeset
    22
 *
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents:
diff changeset
    23
 */
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents:
diff changeset
    24
37985
539c597ee0fa 8154154: Separate G1 specific policy code from the CollectorPolicy class hierarchy
mgerdin
parents: 37262
diff changeset
    25
#ifndef SHARE_VM_GC_G1_G1POLICY_HPP
539c597ee0fa 8154154: Separate G1 specific policy code from the CollectorPolicy class hierarchy
mgerdin
parents: 37262
diff changeset
    26
#define SHARE_VM_GC_G1_G1POLICY_HPP
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6249
diff changeset
    27
31331
a7c714b6cfb3 7097567: G1: abstract and encapsulate collector phases and transitions between them
drwhite
parents: 30874
diff changeset
    28
#include "gc/g1/g1CollectorState.hpp"
33624
509a72e7127b 8140489: Introduce shorthand for average_time_ms in G1CollectorPolicy
ehelin
parents: 33591
diff changeset
    29
#include "gc/g1/g1GCPhaseTimes.hpp"
32378
8dd0e7359751 8133470: Uses of Atomic methods in plab.hpp should be moved to .inline.hpp file
tschatzl
parents: 31331
diff changeset
    30
#include "gc/g1/g1InCSetState.hpp"
34298
f3c9dcc5af96 8136681: Factor out IHOP calculation from G1CollectorPolicy
tschatzl
parents: 34132
diff changeset
    31
#include "gc/g1/g1InitialMarkToMixedTimeTracker.hpp"
30764
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 29795
diff changeset
    32
#include "gc/g1/g1MMUTracker.hpp"
33214
5a00fba36171 8137082: Factor out G1 prediction code from G1CollectorPolicy and clean up
tschatzl
parents: 33204
diff changeset
    33
#include "gc/g1/g1Predictions.hpp"
37985
539c597ee0fa 8154154: Separate G1 specific policy code from the CollectorPolicy class hierarchy
mgerdin
parents: 37262
diff changeset
    34
#include "gc/g1/g1YoungGenSizer.hpp"
539c597ee0fa 8154154: Separate G1 specific policy code from the CollectorPolicy class hierarchy
mgerdin
parents: 37262
diff changeset
    35
#include "gc/shared/gcCause.hpp"
34298
f3c9dcc5af96 8136681: Factor out IHOP calculation from G1CollectorPolicy
tschatzl
parents: 34132
diff changeset
    36
#include "utilities/pair.hpp"
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6249
diff changeset
    37
37985
539c597ee0fa 8154154: Separate G1 specific policy code from the CollectorPolicy class hierarchy
mgerdin
parents: 37262
diff changeset
    38
// A G1Policy makes policy decisions that determine the
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents:
diff changeset
    39
// characteristics of the collector.  Examples include:
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents:
diff changeset
    40
//   * choice of collection set.
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents:
diff changeset
    41
//   * when to collect.
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents:
diff changeset
    42
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents:
diff changeset
    43
class HeapRegion;
37039
79f62b89a7a6 8151178: Move the collection set out of the G1 collector policy
mgerdin
parents: 36365
diff changeset
    44
class G1CollectionSet;
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents:
diff changeset
    45
class CollectionSetChooser;
34298
f3c9dcc5af96 8136681: Factor out IHOP calculation from G1CollectorPolicy
tschatzl
parents: 34132
diff changeset
    46
class G1IHOPControl;
37134
9dd3975ca940 8151711: Move G1 number sequences out of the G1 collector policy
mgerdin
parents: 37070
diff changeset
    47
class G1Analytics;
38183
cb68e4923223 8150721: Don't explicitly manage G1 young regions in YoungList
mgerdin
parents: 38109
diff changeset
    48
class G1SurvivorRegions;
36102
84546518799d 8149820: Move G1YoungGenSizer to g1CollectorPolicy.cpp
ehelin
parents: 35927
diff changeset
    49
class G1YoungGenSizer;
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents:
diff changeset
    50
37985
539c597ee0fa 8154154: Separate G1 specific policy code from the CollectorPolicy class hierarchy
mgerdin
parents: 37262
diff changeset
    51
class G1Policy: public CHeapObj<mtGC> {
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents:
diff changeset
    52
public:
38076
581ddcff38d9 8154753: Turn G1Policy into an interface
ehelin
parents: 38013
diff changeset
    53
  virtual const G1Predictions& predictor() const = 0;
581ddcff38d9 8154753: Turn G1Policy into an interface
ehelin
parents: 38013
diff changeset
    54
  virtual const G1Analytics* analytics()   const = 0;
33214
5a00fba36171 8137082: Factor out G1 prediction code from G1CollectorPolicy and clean up
tschatzl
parents: 33204
diff changeset
    55
34298
f3c9dcc5af96 8136681: Factor out IHOP calculation from G1CollectorPolicy
tschatzl
parents: 34132
diff changeset
    56
  // Add the given number of bytes to the total number of allocated bytes in the old gen.
38076
581ddcff38d9 8154753: Turn G1Policy into an interface
ehelin
parents: 38013
diff changeset
    57
  virtual void add_bytes_allocated_in_old_since_last_gc(size_t bytes) = 0;
34298
f3c9dcc5af96 8136681: Factor out IHOP calculation from G1CollectorPolicy
tschatzl
parents: 34132
diff changeset
    58
11174
fccee5238e70 6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents: 11169
diff changeset
    59
  // Accessors
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents:
diff changeset
    60
38109
6503703df058 8155209: Move setting of young index in cset to G1CollectionSet
mgerdin
parents: 38106
diff changeset
    61
  virtual void set_region_eden(HeapRegion* hr) = 0;
6503703df058 8155209: Move setting of young index in cset to G1CollectionSet
mgerdin
parents: 38106
diff changeset
    62
  virtual void set_region_survivor(HeapRegion* hr) = 0;
33216
8ecefd0f0d10 8138750: Remove dead code in survivor rate group
tschatzl
parents: 33214
diff changeset
    63
38076
581ddcff38d9 8154753: Turn G1Policy into an interface
ehelin
parents: 38013
diff changeset
    64
  virtual void record_max_rs_lengths(size_t rs_lengths) = 0;
33130
a776072941e8 8138969: G1CollectorPolicy should use const for applicable methods
ehelin
parents: 33105
diff changeset
    65
38076
581ddcff38d9 8154753: Turn G1Policy into an interface
ehelin
parents: 38013
diff changeset
    66
  virtual double predict_base_elapsed_time_ms(size_t pending_cards) const = 0;
581ddcff38d9 8154753: Turn G1Policy into an interface
ehelin
parents: 38013
diff changeset
    67
  virtual double predict_base_elapsed_time_ms(size_t pending_cards,
581ddcff38d9 8154753: Turn G1Policy into an interface
ehelin
parents: 38013
diff changeset
    68
                                              size_t scanned_cards) const = 0;
33624
509a72e7127b 8140489: Introduce shorthand for average_time_ms in G1CollectorPolicy
ehelin
parents: 33591
diff changeset
    69
38076
581ddcff38d9 8154753: Turn G1Policy into an interface
ehelin
parents: 38013
diff changeset
    70
  virtual double predict_region_elapsed_time_ms(HeapRegion* hr, bool for_young_gc) const = 0;
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents:
diff changeset
    71
38076
581ddcff38d9 8154753: Turn G1Policy into an interface
ehelin
parents: 38013
diff changeset
    72
  virtual void cset_regions_freed() = 0;
33591
4a2823c696ce 8138975: G1CollectorPolicy::calculate_young_list_target_length should be const
ehelin
parents: 33217
diff changeset
    73
38076
581ddcff38d9 8154753: Turn G1Policy into an interface
ehelin
parents: 38013
diff changeset
    74
  virtual G1MMUTracker* mmu_tracker() = 0;
10528
06fab03478df 7084509: G1: fix inconsistencies and mistakes in the young list target length calculations
tonyp
parents: 10523
diff changeset
    75
38076
581ddcff38d9 8154753: Turn G1Policy into an interface
ehelin
parents: 38013
diff changeset
    76
  virtual const G1MMUTracker* mmu_tracker() const = 0;
10528
06fab03478df 7084509: G1: fix inconsistencies and mistakes in the young list target length calculations
tonyp
parents: 10523
diff changeset
    77
38076
581ddcff38d9 8154753: Turn G1Policy into an interface
ehelin
parents: 38013
diff changeset
    78
  virtual double max_pause_time_ms() const = 0;
33591
4a2823c696ce 8138975: G1CollectorPolicy::calculate_young_list_target_length should be const
ehelin
parents: 33217
diff changeset
    79
38076
581ddcff38d9 8154753: Turn G1Policy into an interface
ehelin
parents: 38013
diff changeset
    80
  virtual size_t pending_cards() const = 0;
37039
79f62b89a7a6 8151178: Move the collection set out of the G1 collector policy
mgerdin
parents: 36365
diff changeset
    81
15861
974c3ccaa5d2 8007036: G1: Too many old regions added to last mixed GC
johnc
parents: 15089
diff changeset
    82
  // Calculate the minimum number of old regions we'll add to the CSet
974c3ccaa5d2 8007036: G1: Too many old regions added to last mixed GC
johnc
parents: 15089
diff changeset
    83
  // during a mixed GC.
38076
581ddcff38d9 8154753: Turn G1Policy into an interface
ehelin
parents: 38013
diff changeset
    84
  virtual uint calc_min_old_cset_length() const = 0;
15861
974c3ccaa5d2 8007036: G1: Too many old regions added to last mixed GC
johnc
parents: 15089
diff changeset
    85
974c3ccaa5d2 8007036: G1: Too many old regions added to last mixed GC
johnc
parents: 15089
diff changeset
    86
  // Calculate the maximum number of old regions we'll add to the CSet
974c3ccaa5d2 8007036: G1: Too many old regions added to last mixed GC
johnc
parents: 15089
diff changeset
    87
  // during a mixed GC.
38076
581ddcff38d9 8154753: Turn G1Policy into an interface
ehelin
parents: 38013
diff changeset
    88
  virtual uint calc_max_old_cset_length() const = 0;
15861
974c3ccaa5d2 8007036: G1: Too many old regions added to last mixed GC
johnc
parents: 15089
diff changeset
    89
974c3ccaa5d2 8007036: G1: Too many old regions added to last mixed GC
johnc
parents: 15089
diff changeset
    90
  // Returns the given amount of uncollected reclaimable space
974c3ccaa5d2 8007036: G1: Too many old regions added to last mixed GC
johnc
parents: 15089
diff changeset
    91
  // as a percentage of the current heap capacity.
38076
581ddcff38d9 8154753: Turn G1Policy into an interface
ehelin
parents: 38013
diff changeset
    92
  virtual double reclaimable_bytes_perc(size_t reclaimable_bytes) const = 0;
15861
974c3ccaa5d2 8007036: G1: Too many old regions added to last mixed GC
johnc
parents: 15089
diff changeset
    93
38076
581ddcff38d9 8154753: Turn G1Policy into an interface
ehelin
parents: 38013
diff changeset
    94
  virtual ~G1Policy() {}
34298
f3c9dcc5af96 8136681: Factor out IHOP calculation from G1CollectorPolicy
tschatzl
parents: 34132
diff changeset
    95
38076
581ddcff38d9 8154753: Turn G1Policy into an interface
ehelin
parents: 38013
diff changeset
    96
  virtual G1CollectorState* collector_state() const = 0;
34298
f3c9dcc5af96 8136681: Factor out IHOP calculation from G1CollectorPolicy
tschatzl
parents: 34132
diff changeset
    97
38076
581ddcff38d9 8154753: Turn G1Policy into an interface
ehelin
parents: 38013
diff changeset
    98
  virtual G1GCPhaseTimes* phase_times() const = 0;
13288
331d5b6725f3 7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents: 12781
diff changeset
    99
10528
06fab03478df 7084509: G1: fix inconsistencies and mistakes in the young list target length calculations
tonyp
parents: 10523
diff changeset
   100
  // Check the current value of the young list RSet lengths and
06fab03478df 7084509: G1: fix inconsistencies and mistakes in the young list target length calculations
tonyp
parents: 10523
diff changeset
   101
  // compare it against the last prediction. If the current value is
06fab03478df 7084509: G1: fix inconsistencies and mistakes in the young list target length calculations
tonyp
parents: 10523
diff changeset
   102
  // higher, recalculate the young list target length prediction.
38076
581ddcff38d9 8154753: Turn G1Policy into an interface
ehelin
parents: 38013
diff changeset
   103
  virtual void revise_young_list_target_length_if_necessary(size_t rs_lengths) = 0;
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents:
diff changeset
   104
10529
9d5bbffbb322 6929868: G1: introduce min / max young gen size bounds
brutisso
parents: 10528
diff changeset
   105
  // This should be called after the heap is resized.
38076
581ddcff38d9 8154753: Turn G1Policy into an interface
ehelin
parents: 38013
diff changeset
   106
  virtual void record_new_heap_size(uint new_number_of_regions) = 0;
10528
06fab03478df 7084509: G1: fix inconsistencies and mistakes in the young list target length calculations
tonyp
parents: 10523
diff changeset
   107
38076
581ddcff38d9 8154753: Turn G1Policy into an interface
ehelin
parents: 38013
diff changeset
   108
  virtual void init(G1CollectedHeap* g1h, G1CollectionSet* collection_set) = 0;
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents:
diff changeset
   109
38076
581ddcff38d9 8154753: Turn G1Policy into an interface
ehelin
parents: 38013
diff changeset
   110
  virtual void note_gc_start() = 0;
33739
e1df46512ae2 8140509: Add note_gc_start to G1CollectorPolicy
ehelin
parents: 33738
diff changeset
   111
38076
581ddcff38d9 8154753: Turn G1Policy into an interface
ehelin
parents: 38013
diff changeset
   112
  virtual bool need_to_start_conc_mark(const char* source, size_t alloc_word_size = 0) = 0;
33808
ee899178e46b 8140597: Forcing an initial mark causes G1 to abort mixed collections
tschatzl
parents: 33747
diff changeset
   113
16993
c9fd6b7ef40e 8010780: G1: Eden occupancy/capacity output wrong after a full GC
johnc
parents: 15861
diff changeset
   114
  // Record the start and end of an evacuation pause.
38076
581ddcff38d9 8154753: Turn G1Policy into an interface
ehelin
parents: 38013
diff changeset
   115
  virtual void record_collection_pause_start(double start_time_sec) = 0;
581ddcff38d9 8154753: Turn G1Policy into an interface
ehelin
parents: 38013
diff changeset
   116
  virtual void record_collection_pause_end(double pause_time_ms, size_t cards_scanned, size_t heap_used_bytes_before_gc) = 0;
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents:
diff changeset
   117
16993
c9fd6b7ef40e 8010780: G1: Eden occupancy/capacity output wrong after a full GC
johnc
parents: 15861
diff changeset
   118
  // Record the start and end of a full collection.
38076
581ddcff38d9 8154753: Turn G1Policy into an interface
ehelin
parents: 38013
diff changeset
   119
  virtual void record_full_collection_start() = 0;
581ddcff38d9 8154753: Turn G1Policy into an interface
ehelin
parents: 38013
diff changeset
   120
  virtual void record_full_collection_end() = 0;
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents:
diff changeset
   121
41284
b4276ec89d0d 8164482: [REDO] G1 does not implement millis_since_last_gc which is needed by RMI GC
jprovino
parents: 40914
diff changeset
   122
  virtual jlong collection_pause_end_millis() = 0;
b4276ec89d0d 8164482: [REDO] G1 does not implement millis_since_last_gc which is needed by RMI GC
jprovino
parents: 40914
diff changeset
   123
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents:
diff changeset
   124
  // Must currently be called while the world is stopped.
38076
581ddcff38d9 8154753: Turn G1Policy into an interface
ehelin
parents: 38013
diff changeset
   125
  virtual void record_concurrent_mark_init_end(double mark_init_elapsed_time_ms) = 0;
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents:
diff changeset
   126
16993
c9fd6b7ef40e 8010780: G1: Eden occupancy/capacity output wrong after a full GC
johnc
parents: 15861
diff changeset
   127
  // Record start and end of remark.
38076
581ddcff38d9 8154753: Turn G1Policy into an interface
ehelin
parents: 38013
diff changeset
   128
  virtual void record_concurrent_mark_remark_start() = 0;
581ddcff38d9 8154753: Turn G1Policy into an interface
ehelin
parents: 38013
diff changeset
   129
  virtual void record_concurrent_mark_remark_end() = 0;
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents:
diff changeset
   130
16993
c9fd6b7ef40e 8010780: G1: Eden occupancy/capacity output wrong after a full GC
johnc
parents: 15861
diff changeset
   131
  // Record start, end, and completion of cleanup.
38076
581ddcff38d9 8154753: Turn G1Policy into an interface
ehelin
parents: 38013
diff changeset
   132
  virtual void record_concurrent_mark_cleanup_start() = 0;
581ddcff38d9 8154753: Turn G1Policy into an interface
ehelin
parents: 38013
diff changeset
   133
  virtual void record_concurrent_mark_cleanup_end() = 0;
581ddcff38d9 8154753: Turn G1Policy into an interface
ehelin
parents: 38013
diff changeset
   134
  virtual void record_concurrent_mark_cleanup_completed() = 0;
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents:
diff changeset
   135
38076
581ddcff38d9 8154753: Turn G1Policy into an interface
ehelin
parents: 38013
diff changeset
   136
  virtual void print_phases() = 0;
33738
1708291bd3d7 8140508: Add utility method for logging phases to G1CollectorPolicy
ehelin
parents: 33624
diff changeset
   137
10243
d00a21009f1f 7039627: G1: avoid BOT updates for survivor allocations and dirty survivor regions incrementally
tonyp
parents: 10236
diff changeset
   138
  // Record how much space we copied during a GC. This is typically
d00a21009f1f 7039627: G1: avoid BOT updates for survivor allocations and dirty survivor regions incrementally
tonyp
parents: 10236
diff changeset
   139
  // called when a GC alloc region is being retired.
38076
581ddcff38d9 8154753: Turn G1Policy into an interface
ehelin
parents: 38013
diff changeset
   140
  virtual void record_bytes_copied_during_gc(size_t bytes) = 0;
10243
d00a21009f1f 7039627: G1: avoid BOT updates for survivor allocations and dirty survivor regions incrementally
tonyp
parents: 10236
diff changeset
   141
d00a21009f1f 7039627: G1: avoid BOT updates for survivor allocations and dirty survivor regions incrementally
tonyp
parents: 10236
diff changeset
   142
  // The amount of space we copied during a GC.
38076
581ddcff38d9 8154753: Turn G1Policy into an interface
ehelin
parents: 38013
diff changeset
   143
  virtual size_t bytes_copied_during_gc() const = 0;
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents:
diff changeset
   144
38183
cb68e4923223 8150721: Don't explicitly manage G1 young regions in YoungList
mgerdin
parents: 38109
diff changeset
   145
  virtual void finalize_collection_set(double target_pause_time_ms, G1SurvivorRegions* survivor) = 0;
11756
28b6fe22e43d 7132029: G1: mixed GC phase lasts for longer than it should
tonyp
parents: 11584
diff changeset
   146
6058
9c9aec6ab47d 6944166: G1: explicit GCs are not always handled correctly
tonyp
parents: 5891
diff changeset
   147
  // This sets the initiate_conc_mark_if_possible() flag to start a
9c9aec6ab47d 6944166: G1: explicit GCs are not always handled correctly
tonyp
parents: 5891
diff changeset
   148
  // new cycle, as long as we are not already in one. It's best if it
9c9aec6ab47d 6944166: G1: explicit GCs are not always handled correctly
tonyp
parents: 5891
diff changeset
   149
  // is called during a safepoint when the test whether a cycle is in
9c9aec6ab47d 6944166: G1: explicit GCs are not always handled correctly
tonyp
parents: 5891
diff changeset
   150
  // progress or not is stable.
38076
581ddcff38d9 8154753: Turn G1Policy into an interface
ehelin
parents: 38013
diff changeset
   151
  virtual bool force_initial_mark_if_outside_cycle(GCCause::Cause gc_cause) = 0;
6058
9c9aec6ab47d 6944166: G1: explicit GCs are not always handled correctly
tonyp
parents: 5891
diff changeset
   152
5243
99e5a8f5d81f 6909756: G1: guarantee(G1CollectedHeap::heap()->mark_in_progress(),"Precondition.")
tonyp
parents: 5240
diff changeset
   153
  // This is called at the very beginning of an evacuation pause (it
99e5a8f5d81f 6909756: G1: guarantee(G1CollectedHeap::heap()->mark_in_progress(),"Precondition.")
tonyp
parents: 5240
diff changeset
   154
  // has to be the first thing that the pause does). If
99e5a8f5d81f 6909756: G1: guarantee(G1CollectedHeap::heap()->mark_in_progress(),"Precondition.")
tonyp
parents: 5240
diff changeset
   155
  // initiate_conc_mark_if_possible() is true, and the concurrent
99e5a8f5d81f 6909756: G1: guarantee(G1CollectedHeap::heap()->mark_in_progress(),"Precondition.")
tonyp
parents: 5240
diff changeset
   156
  // marking thread has completed its work during the previous cycle,
99e5a8f5d81f 6909756: G1: guarantee(G1CollectedHeap::heap()->mark_in_progress(),"Precondition.")
tonyp
parents: 5240
diff changeset
   157
  // it will set during_initial_mark_pause() to so that the pause does
99e5a8f5d81f 6909756: G1: guarantee(G1CollectedHeap::heap()->mark_in_progress(),"Precondition.")
tonyp
parents: 5240
diff changeset
   158
  // the initial-mark work and start a marking cycle.
38076
581ddcff38d9 8154753: Turn G1Policy into an interface
ehelin
parents: 38013
diff changeset
   159
  virtual void decide_on_conc_mark_initiation() = 0;
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents:
diff changeset
   160
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents:
diff changeset
   161
38076
581ddcff38d9 8154753: Turn G1Policy into an interface
ehelin
parents: 38013
diff changeset
   162
  virtual void finished_recalculating_age_indexes(bool is_survivors) = 0;
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents:
diff changeset
   163
38183
cb68e4923223 8150721: Don't explicitly manage G1 young regions in YoungList
mgerdin
parents: 38109
diff changeset
   164
  virtual void transfer_survivors_to_cset(const G1SurvivorRegions* survivors) = 0;
cb68e4923223 8150721: Don't explicitly manage G1 young regions in YoungList
mgerdin
parents: 38109
diff changeset
   165
38076
581ddcff38d9 8154753: Turn G1Policy into an interface
ehelin
parents: 38013
diff changeset
   166
  virtual size_t young_list_target_length() const = 0;
7416
cfe3bfab7d48 6994056: G1: when GC locker is active, extend the Eden instead of allocating into the old gen
tonyp
parents: 7398
diff changeset
   167
38106
da14ba2f0cd9 8155082: Refactor mutator region restriction
sjohanss
parents: 38076
diff changeset
   168
  virtual bool should_allocate_mutator_region() const = 0;
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents:
diff changeset
   169
38076
581ddcff38d9 8154753: Turn G1Policy into an interface
ehelin
parents: 38013
diff changeset
   170
  virtual bool can_expand_young_list() const = 0;
34310
32e3c906b613 8139892: Allow G1CollectorPolicy to specify if reference processing should be enabled
ehelin
parents: 34298
diff changeset
   171
38076
581ddcff38d9 8154753: Turn G1Policy into an interface
ehelin
parents: 38013
diff changeset
   172
  virtual uint young_list_max_length() const = 0;
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents:
diff changeset
   173
38076
581ddcff38d9 8154753: Turn G1Policy into an interface
ehelin
parents: 38013
diff changeset
   174
  virtual bool adaptive_young_list_length() const = 0;
2009
4adf43957a1b 6484959: G1: introduce survivor spaces
apetrusenko
parents: 1374
diff changeset
   175
38076
581ddcff38d9 8154753: Turn G1Policy into an interface
ehelin
parents: 38013
diff changeset
   176
  virtual bool should_process_references() const = 0;
35909
cf5f3c85e179 8148736: Let the G1 heap transition log regions instead of bytes
brutisso
parents: 35907
diff changeset
   177
38076
581ddcff38d9 8154753: Turn G1Policy into an interface
ehelin
parents: 38013
diff changeset
   178
  virtual uint tenuring_threshold() const = 0;
581ddcff38d9 8154753: Turn G1Policy into an interface
ehelin
parents: 38013
diff changeset
   179
  virtual uint max_survivor_regions() = 0;
2009
4adf43957a1b 6484959: G1: introduce survivor spaces
apetrusenko
parents: 1374
diff changeset
   180
38076
581ddcff38d9 8154753: Turn G1Policy into an interface
ehelin
parents: 38013
diff changeset
   181
  virtual void note_start_adding_survivor_regions() = 0;
2009
4adf43957a1b 6484959: G1: introduce survivor spaces
apetrusenko
parents: 1374
diff changeset
   182
38076
581ddcff38d9 8154753: Turn G1Policy into an interface
ehelin
parents: 38013
diff changeset
   183
  virtual void note_stop_adding_survivor_regions() = 0;
7416
cfe3bfab7d48 6994056: G1: when GC locker is active, extend the Eden instead of allocating into the old gen
tonyp
parents: 7398
diff changeset
   184
38076
581ddcff38d9 8154753: Turn G1Policy into an interface
ehelin
parents: 38013
diff changeset
   185
  virtual void record_age_table(AgeTable* age_table) = 0;
40914
90c87069b39c 8164936: G1 age table printout contains contents from previous GC
tschatzl
parents: 38185
diff changeset
   186
  virtual void print_age_table() = 0;
90c87069b39c 8164936: G1 age table printout contains contents from previous GC
tschatzl
parents: 38185
diff changeset
   187
protected:
90c87069b39c 8164936: G1 age table printout contains contents from previous GC
tschatzl
parents: 38185
diff changeset
   188
  virtual size_t desired_survivor_size() const = 0;
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents:
diff changeset
   189
};
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents:
diff changeset
   190
37985
539c597ee0fa 8154154: Separate G1 specific policy code from the CollectorPolicy class hierarchy
mgerdin
parents: 37262
diff changeset
   191
#endif // SHARE_VM_GC_G1_G1POLICY_HPP