1 /* 2 * Copyright (c) 2001, 2016, 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 "runtime/globals.hpp" 29 #include <float.h> // for DBL_MAX 30 // 31 // Defines all globals flags used by the garbage-first compiler. 32 // 33 34 #define G1_FLAGS(develop, develop_pd, product, product_pd, diagnostic, experimental, notproduct, manageable, product_rw, range, constraint) \ 35 \ 36 product(bool, G1UseAdaptiveIHOP, true, \ 37 "Adaptively adjust the initiating heap occupancy from the " \ 38 "initial value of InitiatingHeapOccupancyPercent. The policy " \ 39 "attempts to start marking in time based on application " \ 40 "behavior.") \ 41 \ 42 experimental(size_t, G1AdaptiveIHOPNumInitialSamples, 3, \ 43 "How many completed time periods from initial mark to first " \ 44 "mixed gc are required to use the input values for prediction " \ 45 "of the optimal occupancy to start marking.") \ 46 range(1, max_intx) \ 47 \ 48 product(uintx, G1ConfidencePercent, 50, \ 49 "Confidence level for MMU/pause predictions") \ 50 range(0, 100) \ 51 \ 52 develop(intx, G1MarkingOverheadPercent, 0, \ 53 "Overhead of concurrent marking") \ 54 range(0, 100) \ 55 \ 56 diagnostic(intx, G1SummarizeRSetStatsPeriod, 0, \ 57 "The period (in number of GCs) at which we will generate " \ 58 "update buffer processing info " \ 59 "(0 means do not periodically generate this info); " \ 60 "it also requires that logging is enabled on the trace" \ 61 "level for gc+remset") \ 62 range(0, max_intx) \ 63 \ 64 product(double, G1ConcMarkStepDurationMillis, 10.0, \ 65 "Target duration of individual concurrent marking steps " \ 66 "in milliseconds.") \ 67 range(1.0, DBL_MAX) \ 68 \ 69 product(intx, G1RefProcDrainInterval, 10, \ 70 "The number of discovered reference objects to process before " \ 71 "draining concurrent marking work queues.") \ 72 range(1, max_intx) \ 73 \ 74 experimental(bool, G1UseConcMarkReferenceProcessing, true, \ 75 "If true, enable reference discovery during concurrent " \ 76 "marking and reference processing at the end of remark.") \ 77 \ 78 experimental(double, G1LastPLABAverageOccupancy, 50.0, \ 79 "The expected average occupancy of the last PLAB in " \ 80 "percent.") \ 81 range(0.001, 100.0) \ 82 \ 83 product(size_t, G1SATBBufferSize, 1*K, \ 84 "Number of entries in an SATB log buffer.") \ 85 range(1, max_uintx) \ 86 \ 87 develop(intx, G1SATBProcessCompletedThreshold, 20, \ 88 "Number of completed buffers that triggers log processing.") \ 89 range(0, max_jint) \ 90 \ 91 product(uintx, G1SATBBufferEnqueueingThresholdPercent, 60, \ 92 "Before enqueueing them, each mutator thread tries to do some " \ 93 "filtering on the SATB buffers it generates. If post-filtering " \ 94 "the percentage of retained entries is over this threshold " \ 95 "the buffer will be enqueued for processing. A value of 0 " \ 96 "specifies that mutator threads should not do such filtering.") \ 97 range(0, 100) \ 98 \ 99 experimental(intx, G1ExpandByPercentOfAvailable, 20, \ 100 "When expanding, % of uncommitted space to claim.") \ 101 range(0, 100) \ 102 \ 103 develop(bool, G1RSBarrierRegionFilter, true, \ 104 "If true, generate region filtering code in RS barrier") \ 105 \ 106 product(size_t, G1UpdateBufferSize, 256, \ 107 "Size of an update buffer") \ 108 range(1, NOT_LP64(32*M) LP64_ONLY(1*G)) \ 109 \ 110 product(size_t, G1ConcRefinementYellowZone, 0, \ 111 "Number of enqueued update buffers that will " \ 112 "trigger concurrent processing. Will be selected ergonomically " \ 113 "by default.") \ 114 range(0, SIZE_MAX) \ 115 \ 116 product(size_t, G1ConcRefinementRedZone, 0, \ 117 "Maximum number of enqueued update buffers before mutator " \ 118 "threads start processing new ones instead of enqueueing them. " \ 119 "Will be selected ergonomically by default. Zero will disable " \ 120 "concurrent processing.") \ 121 range(0, SIZE_MAX) \ 122 \ 123 product(size_t, G1ConcRefinementGreenZone, 0, \ 124 "The number of update buffers that are left in the queue by the " \ 125 "concurrent processing threads. Will be selected ergonomically " \ 126 "by default.") \ 127 range(0, SIZE_MAX) \ 128 \ 129 product(intx, G1ConcRefinementServiceIntervalMillis, 300, \ 130 "The last concurrent refinement thread wakes up every " \ 131 "specified number of milliseconds to do miscellaneous work.") \ 132 range(0, max_jint) \ 133 \ 134 product(size_t, G1ConcRefinementThresholdStep, 0, \ 135 "Each time the rset update queue increases by this amount " \ 136 "activate the next refinement thread if available. " \ 137 "Will be selected ergonomically by default.") \ 138 range(0, SIZE_MAX) \ 139 \ 140 product(intx, G1RSetUpdatingPauseTimePercent, 10, \ 141 "A target percentage of time that is allowed to be spend on " \ 142 "process RS update buffers during the collection pause.") \ 143 range(0, 100) \ 144 \ 145 product(bool, G1UseAdaptiveConcRefinement, true, \ 146 "Select green, yellow and red zones adaptively to meet the " \ 147 "the pause requirements.") \ 148 \ 149 product(size_t, G1ConcRSLogCacheSize, 10, \ 150 "Log base 2 of the length of conc RS hot-card cache.") \ 151 range(0, 27) \ 152 \ 153 product(uintx, G1ConcRSHotCardLimit, 4, \ 154 "The threshold that defines (>=) a hot card.") \ 155 range(0, max_jubyte) \ 156 \ 157 develop(intx, G1RSetRegionEntriesBase, 256, \ 158 "Max number of regions in a fine-grain table per MB.") \ 159 range(1, max_jint/wordSize) \ 160 \ 161 product(intx, G1RSetRegionEntries, 0, \ 162 "Max number of regions for which we keep bitmaps." \ 163 "Will be set ergonomically by default") \ 164 range(0, max_jint/wordSize) \ 165 constraint(G1RSetRegionEntriesConstraintFunc,AfterErgo) \ 166 \ 167 develop(intx, G1RSetSparseRegionEntriesBase, 4, \ 168 "Max number of entries per region in a sparse table " \ 169 "per MB.") \ 170 range(1, max_jint/wordSize) \ 171 \ 172 product(intx, G1RSetSparseRegionEntries, 0, \ 173 "Max number of entries per region in a sparse table." \ 174 "Will be set ergonomically by default.") \ 175 range(0, max_jint/wordSize) \ 176 constraint(G1RSetSparseRegionEntriesConstraintFunc,AfterErgo) \ 177 \ 178 develop(intx, G1MaxVerifyFailures, -1, \ 179 "The maximum number of verification failures to print. " \ 180 "-1 means print all.") \ 181 range(-1, max_jint) \ 182 \ 183 develop(bool, G1ScrubRemSets, true, \ 184 "When true, do RS scrubbing after cleanup.") \ 185 \ 186 develop(intx, G1YoungSurvRateNumRegionsSummary, 0, \ 187 "the number of regions for which we'll print a surv rate " \ 188 "summary.") \ 189 range(0, max_intx) \ 190 constraint(G1YoungSurvRateNumRegionsSummaryConstraintFunc,AfterErgo)\ 191 \ 192 product(uintx, G1ReservePercent, 10, \ 193 "It determines the minimum reserve we should have in the heap " \ 194 "to minimize the probability of promotion failure.") \ 195 range(0, 50) \ 196 \ 197 develop(bool, G1HRRSUseSparseTable, true, \ 198 "When true, use sparse table to save space.") \ 199 \ 200 develop(bool, G1HRRSFlushLogBuffersOnVerify, false, \ 201 "Forces flushing of log buffers before verification.") \ 202 \ 203 product(size_t, G1HeapRegionSize, 0, \ 204 "Size of the G1 regions.") \ 205 range(0, 32*M) \ 206 constraint(G1HeapRegionSizeConstraintFunc,AfterMemoryInit) \ 207 \ 208 product(uintx, G1ConcRefinementThreads, 0, \ 209 "If non-0 is the number of parallel rem set update threads, " \ 210 "otherwise the value is determined ergonomically.") \ 211 range(0, (max_jint-1)/wordSize) \ 212 \ 213 develop(bool, G1VerifyCTCleanup, false, \ 214 "Verify card table cleanup.") \ 215 \ 216 product(size_t, G1RSetScanBlockSize, 64, \ 217 "Size of a work unit of cards claimed by a worker thread" \ 218 "during RSet scanning.") \ 219 range(1, max_uintx) \ 220 \ 221 develop(uintx, G1SecondaryFreeListAppendLength, 5, \ 222 "The number of regions we will add to the secondary free list " \ 223 "at every append operation") \ 224 \ 225 develop(bool, G1StressConcRegionFreeing, false, \ 226 "It stresses the concurrent region freeing operation") \ 227 \ 228 develop(uintx, G1StressConcRegionFreeingDelayMillis, 0, \ 229 "Artificial delay during concurrent region freeing") \ 230 \ 231 develop(uintx, G1DummyRegionsPerGC, 0, \ 232 "The number of dummy regions G1 will allocate at the end of " \ 233 "each evacuation pause in order to artificially fill up the " \ 234 "heap and stress the marking implementation.") \ 235 \ 236 develop(bool, G1ExitOnExpansionFailure, false, \ 237 "Raise a fatal VM exit out of memory failure in the event " \ 238 " that heap expansion fails due to running out of swap.") \ 239 \ 240 develop(uintx, G1ConcMarkForceOverflow, 0, \ 241 "The number of times we'll force an overflow during " \ 242 "concurrent marking") \ 243 \ 244 experimental(uintx, G1MaxNewSizePercent, 60, \ 245 "Percentage (0-100) of the heap size to use as default " \ 246 " maximum young gen size.") \ 247 range(0, 100) \ 248 constraint(G1MaxNewSizePercentConstraintFunc,AfterErgo) \ 249 \ 250 experimental(uintx, G1NewSizePercent, 5, \ 251 "Percentage (0-100) of the heap size to use as default " \ 252 "minimum young gen size.") \ 253 range(0, 100) \ 254 constraint(G1NewSizePercentConstraintFunc,AfterErgo) \ 255 \ 256 experimental(uintx, G1MixedGCLiveThresholdPercent, 85, \ 257 "Threshold for regions to be considered for inclusion in the " \ 258 "collection set of mixed GCs. " \ 259 "Regions with live bytes exceeding this will not be collected.") \ 260 range(0, 100) \ 261 \ 262 product(uintx, G1HeapWastePercent, 5, \ 263 "Amount of space, expressed as a percentage of the heap size, " \ 264 "that G1 is willing not to collect to avoid expensive GCs.") \ 265 range(0, 100) \ 266 \ 267 product(uintx, G1MixedGCCountTarget, 8, \ 268 "The target number of mixed GCs after a marking cycle.") \ 269 range(0, max_uintx) \ 270 \ 271 experimental(bool, G1EagerReclaimHumongousObjects, true, \ 272 "Try to reclaim dead large objects at every young GC.") \ 273 \ 274 experimental(bool, G1EagerReclaimHumongousObjectsWithStaleRefs, true, \ 275 "Try to reclaim dead large objects that have a few stale " \ 276 "references at every young GC.") \ 277 \ 278 experimental(uintx, G1OldCSetRegionThresholdPercent, 10, \ 279 "An upper bound for the number of old CSet regions expressed " \ 280 "as a percentage of the heap size.") \ 281 range(0, 100) \ 282 \ 283 notproduct(bool, G1EvacuationFailureALot, false, \ 284 "Force use of evacuation failure handling during certain " \ 285 "evacuation pauses") \ 286 \ 287 develop(uintx, G1EvacuationFailureALotCount, 1000, \ 288 "Number of successful evacuations between evacuation failures " \ 289 "occurring at object copying") \ 290 \ 291 develop(uintx, G1EvacuationFailureALotInterval, 5, \ 292 "Total collections between forced triggering of evacuation " \ 293 "failures") \ 294 \ 295 develop(bool, G1EvacuationFailureALotDuringConcMark, true, \ 296 "Force use of evacuation failure handling during evacuation " \ 297 "pauses when marking is in progress") \ 298 \ 299 develop(bool, G1EvacuationFailureALotDuringInitialMark, true, \ 300 "Force use of evacuation failure handling during initial mark " \ 301 "evacuation pauses") \ 302 \ 303 develop(bool, G1EvacuationFailureALotDuringYoungGC, true, \ 304 "Force use of evacuation failure handling during young " \ 305 "evacuation pauses") \ 306 \ 307 develop(bool, G1EvacuationFailureALotDuringMixedGC, true, \ 308 "Force use of evacuation failure handling during mixed " \ 309 "evacuation pauses") \ 310 \ 311 diagnostic(bool, G1VerifyRSetsDuringFullGC, false, \ 312 "If true, perform verification of each heap region's " \ 313 "remembered set when verifying the heap during a full GC.") \ 314 \ 315 diagnostic(bool, G1VerifyHeapRegionCodeRoots, false, \ 316 "Verify the code root lists attached to each heap region.") \ 317 \ 318 develop(bool, G1VerifyBitmaps, false, \ 319 "Verifies the consistency of the marking bitmaps") 320 321 G1_FLAGS(DECLARE_DEVELOPER_FLAG, \ 322 DECLARE_PD_DEVELOPER_FLAG, \ 323 DECLARE_PRODUCT_FLAG, \ 324 DECLARE_PD_PRODUCT_FLAG, \ 325 DECLARE_DIAGNOSTIC_FLAG, \ 326 DECLARE_EXPERIMENTAL_FLAG, \ 327 DECLARE_NOTPRODUCT_FLAG, \ 328 DECLARE_MANAGEABLE_FLAG, \ 329 DECLARE_PRODUCT_RW_FLAG, \ 330 IGNORE_RANGE, \ 331 IGNORE_CONSTRAINT) 332 333 #endif // SHARE_VM_GC_G1_G1_GLOBALS_HPP