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