1 /* 2 * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 * 23 */ 24 25 #ifndef SHARE_VM_GC_G1_G1_GLOBALS_HPP 26 #define SHARE_VM_GC_G1_G1_GLOBALS_HPP 27 28 #include <float.h> // for DBL_MAX 29 // 30 // Defines all globals flags used by the garbage-first compiler. 31 // 32 33 #define GC_G1_FLAGS(develop, \ 34 develop_pd, \ 35 product, \ 36 product_pd, \ 37 diagnostic, \ 38 diagnostic_pd, \ 39 experimental, \ 40 notproduct, \ 41 manageable, \ 42 product_rw, \ 43 lp64_product, \ 44 range, \ 45 constraint, \ 46 writeable) \ 47 \ 48 product(bool, G1UseAdaptiveIHOP, true, \ 49 "Adaptively adjust the initiating heap occupancy from the " \ 50 "initial value of InitiatingHeapOccupancyPercent. The policy " \ 51 "attempts to start marking in time based on application " \ 52 "behavior.") \ 53 \ 54 experimental(size_t, G1AdaptiveIHOPNumInitialSamples, 3, \ 55 "How many completed time periods from initial mark to first " \ 56 "mixed gc are required to use the input values for prediction " \ 57 "of the optimal occupancy to start marking.") \ 58 range(1, max_intx) \ 59 \ 60 product(uintx, G1ConfidencePercent, 50, \ 61 "Confidence level for MMU/pause predictions") \ 62 range(0, 100) \ 63 \ 64 diagnostic(intx, G1SummarizeRSetStatsPeriod, 0, \ 65 "The period (in number of GCs) at which we will generate " \ 66 "update buffer processing info " \ 67 "(0 means do not periodically generate this info); " \ 68 "it also requires that logging is enabled on the trace" \ 69 "level for gc+remset") \ 70 range(0, max_intx) \ 71 \ 72 product(double, G1ConcMarkStepDurationMillis, 10.0, \ 73 "Target duration of individual concurrent marking steps " \ 74 "in milliseconds.") \ 75 range(1.0, DBL_MAX) \ 76 \ 77 product(uint, G1RefProcDrainInterval, 1000, \ 78 "The number of discovered reference objects to process before " \ 79 "draining concurrent marking work queues.") \ 80 range(1, INT_MAX) \ 81 \ 82 experimental(double, G1LastPLABAverageOccupancy, 50.0, \ 83 "The expected average occupancy of the last PLAB in " \ 84 "percent.") \ 85 range(0.001, 100.0) \ 86 \ 87 product(size_t, G1SATBBufferSize, 1*K, \ 88 "Number of entries in an SATB log buffer.") \ 89 range(1, max_uintx) \ 90 \ 91 develop(intx, G1SATBProcessCompletedThreshold, 20, \ 92 "Number of completed buffers that triggers log processing.") \ 93 range(0, max_jint) \ 94 \ 95 product(uintx, G1SATBBufferEnqueueingThresholdPercent, 60, \ 96 "Before enqueueing them, each mutator thread tries to do some " \ 97 "filtering on the SATB buffers it generates. If post-filtering " \ 98 "the percentage of retained entries is over this threshold " \ 99 "the buffer will be enqueued for processing. A value of 0 " \ 100 "specifies that mutator threads should not do such filtering.") \ 101 range(0, 100) \ 102 \ 103 experimental(intx, G1ExpandByPercentOfAvailable, 20, \ 104 "When expanding, % of uncommitted space to claim.") \ 105 range(0, 100) \ 106 \ 107 develop(bool, G1RSBarrierRegionFilter, true, \ 108 "If true, generate region filtering code in RS barrier") \ 109 \ 110 product(size_t, G1UpdateBufferSize, 256, \ 111 "Size of an update buffer") \ 112 range(1, NOT_LP64(32*M) LP64_ONLY(1*G)) \ 113 \ 114 product(size_t, G1ConcRefinementYellowZone, 0, \ 115 "Number of enqueued update buffers that will " \ 116 "trigger concurrent processing. Will be selected ergonomically " \ 117 "by default.") \ 118 range(0, max_intx) \ 119 \ 120 product(size_t, G1ConcRefinementRedZone, 0, \ 121 "Maximum number of enqueued update buffers before mutator " \ 122 "threads start processing new ones instead of enqueueing them. " \ 123 "Will be selected ergonomically by default.") \ 124 range(0, max_intx) \ 125 \ 126 product(size_t, G1ConcRefinementGreenZone, 0, \ 127 "The number of update buffers that are left in the queue by the " \ 128 "concurrent processing threads. Will be selected ergonomically " \ 129 "by default.") \ 130 range(0, max_intx) \ 131 \ 132 product(uintx, G1ConcRefinementServiceIntervalMillis, 300, \ 133 "The last concurrent refinement thread wakes up every " \ 134 "specified number of milliseconds to do miscellaneous work.") \ 135 range(0, max_jint) \ 136 \ 137 product(size_t, G1ConcRefinementThresholdStep, 2, \ 138 "Each time the rset update queue increases by this amount " \ 139 "activate the next refinement thread if available. " \ 140 "The actual step size will be selected ergonomically by " \ 141 "default, with this value used to determine a lower bound.") \ 142 range(1, SIZE_MAX) \ 143 \ 144 product(intx, G1RSetUpdatingPauseTimePercent, 10, \ 145 "A target percentage of time that is allowed to be spend on " \ 146 "process RS update buffers during the collection pause.") \ 147 range(0, 100) \ 148 \ 149 product(bool, G1UseAdaptiveConcRefinement, true, \ 150 "Select green, yellow and red zones adaptively to meet the " \ 151 "the pause requirements.") \ 152 \ 153 product(size_t, G1ConcRSLogCacheSize, 10, \ 154 "Log base 2 of the length of conc RS hot-card cache.") \ 155 range(0, 27) \ 156 \ 157 product(uintx, G1ConcRSHotCardLimit, 4, \ 158 "The threshold that defines (>=) a hot card.") \ 159 range(0, max_jubyte) \ 160 \ 161 develop(intx, G1RSetRegionEntriesBase, 256, \ 162 "Max number of regions in a fine-grain table per MB.") \ 163 range(1, max_jint/wordSize) \ 164 \ 165 product(intx, G1RSetRegionEntries, 0, \ 166 "Max number of regions for which we keep bitmaps." \ 167 "Will be set ergonomically by default") \ 168 range(0, max_jint/wordSize) \ 169 constraint(G1RSetRegionEntriesConstraintFunc,AfterErgo) \ 170 \ 171 develop(intx, G1RSetSparseRegionEntriesBase, 4, \ 172 "Max number of entries per region in a sparse table " \ 173 "per MB.") \ 174 range(1, max_jint/wordSize) \ 175 \ 176 product(intx, G1RSetSparseRegionEntries, 0, \ 177 "Max number of entries per region in a sparse table." \ 178 "Will be set ergonomically by default.") \ 179 range(0, max_jint/wordSize) \ 180 constraint(G1RSetSparseRegionEntriesConstraintFunc,AfterErgo) \ 181 \ 182 develop(intx, G1MaxVerifyFailures, -1, \ 183 "The maximum number of verification failures to print. " \ 184 "-1 means print all.") \ 185 range(-1, max_jint) \ 186 \ 187 product(uintx, G1ReservePercent, 10, \ 188 "It determines the minimum reserve we should have in the heap " \ 189 "to minimize the probability of promotion failure.") \ 190 range(0, 50) \ 191 \ 192 develop(bool, G1HRRSUseSparseTable, true, \ 193 "When true, use sparse table to save space.") \ 194 \ 195 product(size_t, G1HeapRegionSize, 0, \ 196 "Size of the G1 regions.") \ 197 range(0, 32*M) \ 198 constraint(G1HeapRegionSizeConstraintFunc,AfterMemoryInit) \ 199 \ 200 product(uint, G1ConcRefinementThreads, 0, \ 201 "The number of parallel rem set update threads. " \ 202 "Will be set ergonomically by default.") \ 203 range(0, (max_jint-1)/wordSize) \ 204 \ 205 develop(bool, G1VerifyCTCleanup, false, \ 206 "Verify card table cleanup.") \ 207 \ 208 product(size_t, G1RSetScanBlockSize, 64, \ 209 "Size of a work unit of cards claimed by a worker thread" \ 210 "during RSet scanning.") \ 211 range(1, max_uintx) \ 212 \ 213 develop(uintx, G1DummyRegionsPerGC, 0, \ 214 "The number of dummy regions G1 will allocate at the end of " \ 215 "each evacuation pause in order to artificially fill up the " \ 216 "heap and stress the marking implementation.") \ 217 \ 218 develop(bool, G1ExitOnExpansionFailure, false, \ 219 "Raise a fatal VM exit out of memory failure in the event " \ 220 " that heap expansion fails due to running out of swap.") \ 221 \ 222 experimental(uintx, G1MaxNewSizePercent, 60, \ 223 "Percentage (0-100) of the heap size to use as default " \ 224 " maximum young gen size.") \ 225 range(0, 100) \ 226 constraint(G1MaxNewSizePercentConstraintFunc,AfterErgo) \ 227 \ 228 experimental(uintx, G1NewSizePercent, 5, \ 229 "Percentage (0-100) of the heap size to use as default " \ 230 "minimum young gen size.") \ 231 range(0, 100) \ 232 constraint(G1NewSizePercentConstraintFunc,AfterErgo) \ 233 \ 234 experimental(uintx, G1MixedGCLiveThresholdPercent, 85, \ 235 "Threshold for regions to be considered for inclusion in the " \ 236 "collection set of mixed GCs. " \ 237 "Regions with live bytes exceeding this will not be collected.") \ 238 range(0, 100) \ 239 \ 240 product(uintx, G1HeapWastePercent, 5, \ 241 "Amount of space, expressed as a percentage of the heap size, " \ 242 "that G1 is willing not to collect to avoid expensive GCs.") \ 243 range(0, 100) \ 244 \ 245 product(uintx, G1MixedGCCountTarget, 8, \ 246 "The target number of mixed GCs after a marking cycle.") \ 247 range(0, max_uintx) \ 248 \ 249 experimental(bool, G1PretouchAuxiliaryMemory, false, \ 250 "Pre-touch large auxiliary data structures used by the GC.") \ 251 \ 252 experimental(bool, G1EagerReclaimHumongousObjects, true, \ 253 "Try to reclaim dead large objects at every young GC.") \ 254 \ 255 experimental(bool, G1EagerReclaimHumongousObjectsWithStaleRefs, true, \ 256 "Try to reclaim dead large objects that have a few stale " \ 257 "references at every young GC.") \ 258 \ 259 experimental(size_t, G1RebuildRemSetChunkSize, 256 * K, \ 260 "Chunk size used for rebuilding the remembered set.") \ 261 range(4 * K, 32 * M) \ 262 \ 263 experimental(uintx, G1OldCSetRegionThresholdPercent, 10, \ 264 "An upper bound for the number of old CSet regions expressed " \ 265 "as a percentage of the heap size.") \ 266 range(0, 100) \ 267 \ 268 notproduct(bool, G1EvacuationFailureALot, false, \ 269 "Force use of evacuation failure handling during certain " \ 270 "evacuation pauses") \ 271 \ 272 develop(uintx, G1EvacuationFailureALotCount, 1000, \ 273 "Number of successful evacuations between evacuation failures " \ 274 "occurring at object copying") \ 275 \ 276 develop(uintx, G1EvacuationFailureALotInterval, 5, \ 277 "Total collections between forced triggering of evacuation " \ 278 "failures") \ 279 \ 280 develop(bool, G1EvacuationFailureALotDuringConcMark, true, \ 281 "Force use of evacuation failure handling during evacuation " \ 282 "pauses when marking is in progress") \ 283 \ 284 develop(bool, G1EvacuationFailureALotDuringInitialMark, true, \ 285 "Force use of evacuation failure handling during initial mark " \ 286 "evacuation pauses") \ 287 \ 288 develop(bool, G1EvacuationFailureALotDuringYoungGC, true, \ 289 "Force use of evacuation failure handling during young " \ 290 "evacuation pauses") \ 291 \ 292 develop(bool, G1EvacuationFailureALotDuringMixedGC, true, \ 293 "Force use of evacuation failure handling during mixed " \ 294 "evacuation pauses") \ 295 \ 296 diagnostic(bool, G1VerifyRSetsDuringFullGC, false, \ 297 "If true, perform verification of each heap region's " \ 298 "remembered set when verifying the heap during a full GC.") \ 299 \ 300 diagnostic(bool, G1VerifyHeapRegionCodeRoots, false, \ 301 "Verify the code root lists attached to each heap region.") \ 302 \ 303 develop(bool, G1VerifyBitmaps, false, \ 304 "Verifies the consistency of the marking bitmaps") 305 306 #endif // SHARE_VM_GC_G1_G1_GLOBALS_HPP