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