1 /* 2 * Copyright (c) 2016, 2020, Red Hat, Inc. All rights reserved. 3 * 4 * This code is free software; you can redistribute it and/or modify it 5 * under the terms of the GNU General Public License version 2 only, as 6 * published by the Free Software Foundation. 7 * 8 * This code is distributed in the hope that it will be useful, but WITHOUT 9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 11 * version 2 for more details (a copy is included in the LICENSE file that 12 * accompanied this code). 13 * 14 * You should have received a copy of the GNU General Public License version 15 * 2 along with this work; if not, write to the Free Software Foundation, 16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 17 * 18 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 19 * or visit www.oracle.com if you need additional information or have any 20 * questions. 21 * 22 */ 23 24 #ifndef SHARE_VM_GC_SHENANDOAH_SHENANDOAH_GLOBALS_HPP 25 #define SHARE_VM_GC_SHENANDOAH_SHENANDOAH_GLOBALS_HPP 26 27 #define GC_SHENANDOAH_FLAGS(develop, \ 28 develop_pd, \ 29 product, \ 30 product_pd, \ 31 diagnostic, \ 32 diagnostic_pd, \ 33 experimental, \ 34 notproduct, \ 35 manageable, \ 36 product_rw, \ 37 lp64_product, \ 38 range, \ 39 constraint, \ 40 writeable) \ 41 \ 42 experimental(size_t, ShenandoahHeapRegionSize, 0, \ 43 "Size of the Shenandoah regions. Set to zero to detect " \ 44 "automatically.") \ 45 \ 46 experimental(size_t, ShenandoahTargetNumRegions, 2048, \ 47 "Target number of regions. We try to get around that many " \ 48 "regions, based on Shenandoah{Min,Max}RegionSize.") \ 49 \ 50 experimental(size_t, ShenandoahMinRegionSize, 256 * K, \ 51 "Minimum Shenandoah heap region size.") \ 52 \ 53 experimental(size_t, ShenandoahMaxRegionSize, 32 * M, \ 54 "Maximum Shenandoah heap region size.") \ 55 \ 56 experimental(intx, ShenandoahHumongousThreshold, 100, \ 57 "How large should the object be to get allocated in humongous " \ 58 "region, in percents of heap region size. This also caps the " \ 59 "maximum TLAB size.") \ 60 range(1, 100) \ 61 \ 62 product(ccstr, ShenandoahGCHeuristics, "adaptive", \ 63 "The heuristics to use in Shenandoah GC. Possible values:" \ 64 " *) adaptive - adapt to maintain the given amount of free heap;" \ 65 " *) static - start concurrent GC when static free heap " \ 66 " threshold and static allocation threshold are " \ 67 " tripped;" \ 68 " *) aggressive - run concurrent GC continuously, evacuate " \ 69 " everything;" \ 70 " *) compact - run GC with lower footprint target, may end up " \ 71 " doing continuous GC, evacuate lots of live " \ 72 " objects, uncommit heap aggressively;") \ 73 \ 74 product(ccstr, ShenandoahGCMode, "normal", \ 75 "The GC mode to use in Shenandoah GC. Possible values" \ 76 " *) normal - normal GC (mark-evac-update)" \ 77 " *) traversal - traversal GC (single-pass)" \ 78 " *) passive - disable concurrent GC, do stop-the-world GC") \ 79 \ 80 experimental(ccstr, ShenandoahUpdateRefsEarly, "adaptive", \ 81 "Run a separate concurrent reference updating phase after" \ 82 "concurrent evacuation. Possible values: 'on', 'off', 'adaptive'")\ 83 \ 84 experimental(uintx, ShenandoahRefProcFrequency, 5, \ 85 "How often should (weak, soft, etc) references be processed. " \ 86 "References get processed at every Nth GC cycle. Set to zero " \ 87 "to disable reference processing.") \ 88 \ 89 experimental(uintx, ShenandoahUnloadClassesFrequency, 5, \ 90 "How often should classes get unloaded. " \ 91 "Class unloading is performed at every Nth GC cycle. " \ 92 "Set to zero to disable class unloading during concurrent GC.") \ 93 \ 94 experimental(uintx, ShenandoahGarbageThreshold, 60, \ 95 "Sets the percentage of garbage a region need to contain before " \ 96 "it can be marked for collection. Does not apply to all " \ 97 "heuristics.") \ 98 range(0,100) \ 99 \ 100 experimental(uintx, ShenandoahInitFreeThreshold, 70, \ 101 "Initial remaining free heap threshold for learning steps in " \ 102 "heuristics. In percents of total heap size. Does not apply to " \ 103 "all heuristics.") \ 104 range(0,100) \ 105 \ 106 experimental(uintx, ShenandoahMinFreeThreshold, 10, \ 107 "Minimum remaining free space threshold, after which collection " \ 108 "definitely triggers. Does not apply to all heuristics.") \ 109 range(0,100) \ 110 \ 111 experimental(uintx, ShenandoahAllocationThreshold, 0, \ 112 "Set percentage of memory allocated since last GC cycle before " \ 113 "a new GC cycle can be started. Set to zero to effectively " \ 114 "disable.") \ 115 range(0,100) \ 116 \ 117 experimental(uintx, ShenandoahLearningSteps, 5, \ 118 "Number of GC cycles to run in order to learn application " \ 119 "and GC performance for adaptive heuristics.") \ 120 range(0,100) \ 121 \ 122 experimental(uintx, ShenandoahImmediateThreshold, 90, \ 123 "If mark identifies more than this much immediate garbage " \ 124 "regions, it shall recycle them, and shall not continue the " \ 125 "rest of the GC cycle. The value is in percents of total " \ 126 "number of candidate regions for collection set. Setting this " \ 127 "threshold to 100% effectively disables this shortcut.") \ 128 range(0,100) \ 129 \ 130 experimental(uintx, ShenandoahMergeUpdateRefsMinGap, 100, \ 131 "If GC is currently running in separate update-refs mode " \ 132 "this numbers gives the threshold when to switch to " \ 133 "merged update-refs mode. Number is percentage relative to" \ 134 "duration(marking)+duration(update-refs).") \ 135 \ 136 experimental(uintx, ShenandoahMergeUpdateRefsMaxGap, 200, \ 137 "If GC is currently running in merged update-refs mode " \ 138 "this numbers gives the threshold when to switch to " \ 139 "separate update-refs mode. Number is percentage relative " \ 140 "to duration(marking)+duration(update-refs).") \ 141 \ 142 experimental(uintx, ShenandoahGuaranteedGCInterval, 5*60*1000, \ 143 "Most heuristics would guarantee a concurrent GC cycle at " \ 144 "least with this interval. This is useful when large idle " \ 145 "intervals are present, where GC can run without stealing " \ 146 "time from active application. Time is in milliseconds. " \ 147 "(Setting this interval to 0 disables this feature).") \ 148 \ 149 experimental(bool, ShenandoahAlwaysClearSoftRefs, false, \ 150 "Clear soft references always, instead of using any smart " \ 151 "cleanup policy. This minimizes footprint at expense of more " \ 152 "softref churn in applications.") \ 153 \ 154 experimental(bool, ShenandoahUncommit, true, \ 155 "Allow Shenandoah to uncommit unused memory.") \ 156 \ 157 experimental(uintx, ShenandoahUncommitDelay, 5*60*1000, \ 158 "Shenandoah would start to uncommit memory for regions that were" \ 159 " not used for more than this time. First use after that would " \ 160 "incur allocation stalls. Actively used regions would never be " \ 161 "uncommitted, because they never decay. Time is in milliseconds." \ 162 "Setting this delay to 0 effectively makes Shenandoah to " \ 163 "uncommit the regions almost immediately.") \ 164 \ 165 experimental(bool, ShenandoahRegionSampling, false, \ 166 "Turns on heap region sampling via JVMStat") \ 167 \ 168 experimental(int, ShenandoahRegionSamplingRate, 40, \ 169 "Sampling rate for heap region sampling. " \ 170 "Number of milliseconds between samples") \ 171 \ 172 experimental(uintx, ShenandoahControlIntervalMin, 1, \ 173 "The minumum sleep interval for control loop that drives " \ 174 "the cycles. Lower values would increase GC responsiveness " \ 175 "to changing heap conditions, at the expense of higher perf " \ 176 "overhead. Time is in milliseconds.") \ 177 \ 178 experimental(uintx, ShenandoahControlIntervalMax, 10, \ 179 "The maximum sleep interval for control loop that drives " \ 180 "the cycles. Lower values would increase GC responsiveness " \ 181 "to changing heap conditions, at the expense of higher perf " \ 182 "overhead. Time is in milliseconds.") \ 183 \ 184 experimental(uintx, ShenandoahControlIntervalAdjustPeriod, 1000, \ 185 "The time period for one step in control loop interval " \ 186 "adjustment. Lower values make adjustments faster, at the " \ 187 "expense of higher perf overhead. Time is in milliseconds.") \ 188 \ 189 experimental(bool, ShenandoahCriticalControlThreadPriority, false, \ 190 "Shenandoah control thread runs at critical scheduling priority.")\ 191 \ 192 diagnostic(bool, ShenandoahVerify, false, \ 193 "Verify the Shenandoah garbage collector") \ 194 \ 195 diagnostic(intx, ShenandoahVerifyLevel, 4, \ 196 "Shenandoah verification level: " \ 197 "0 = basic heap checks; " \ 198 "1 = previous level, plus basic region checks; " \ 199 "2 = previous level, plus all roots; " \ 200 "3 = previous level, plus all reachable objects; " \ 201 "4 = previous level, plus all marked objects") \ 202 \ 203 diagnostic(bool, ShenandoahElasticTLAB, true, \ 204 "Use Elastic TLABs with Shenandoah") \ 205 \ 206 diagnostic(bool, ShenandoahAllowMixedAllocs, true, \ 207 "Allow mixing mutator and collector allocations in a single " \ 208 "region") \ 209 \ 210 experimental(uintx, ShenandoahAllocSpikeFactor, 5, \ 211 "The amount of heap space to reserve for absorbing the " \ 212 "allocation spikes. Larger value wastes more memory in " \ 213 "non-emergency cases, but provides more safety in emergency " \ 214 "cases. In percents of total heap size.") \ 215 range(0,100) \ 216 \ 217 experimental(uintx, ShenandoahEvacReserve, 5, \ 218 "Maximum amount of free space to reserve for evacuation. " \ 219 "Larger values make GC more aggressive, while leaving less " \ 220 "headroom for application to allocate in. " \ 221 "In percents of total heap size.") \ 222 range(1,100) \ 223 \ 224 experimental(double, ShenandoahEvacWaste, 1.2, \ 225 "How much waste evacuations produce within the reserved " \ 226 "space. Larger values make evacuations more resilient " \ 227 "against allocation failures, at expense of smaller csets " \ 228 "on each cycle.") \ 229 range(1.0,100.0) \ 230 \ 231 experimental(bool, ShenandoahEvacReserveOverflow, true, \ 232 "Allow evacuations to overflow the reserved space. " \ 233 "Enabling it will make evacuations more resilient when " \ 234 "evacuation reserve/waste is incorrect, at the risk that " \ 235 "application allocations run out of memory too early.") \ 236 \ 237 diagnostic(bool, ShenandoahAllocationTrace, false, \ 238 "Trace allocation latencies and stalls. Can be expensive when " \ 239 "lots of allocations happen, and may introduce scalability " \ 240 "bottlenecks.") \ 241 \ 242 diagnostic(intx, ShenandoahAllocationStallThreshold, 10000, \ 243 "When allocation tracing is enabled, the allocation stalls " \ 244 "larger than this threshold would be reported as warnings. " \ 245 "Time is in microseconds.") \ 246 \ 247 experimental(uintx, ShenandoahEvacAssist, 10, \ 248 "How many objects to evacuate on LRB assist path. " \ 249 "Use zero to disable.") \ 250 \ 251 experimental(bool, ShenandoahPacing, true, \ 252 "Pace application allocations to give GC chance to start " \ 253 "and complete before allocation failure is reached.") \ 254 \ 255 experimental(uintx, ShenandoahPacingMaxDelay, 10, \ 256 "Max delay for pacing application allocations. " \ 257 "Time is in milliseconds.") \ 258 \ 259 experimental(uintx, ShenandoahPacingIdleSlack, 2, \ 260 "Percent of heap counted as non-taxable allocations during idle. "\ 261 "Larger value makes the pacing milder during idle phases, " \ 262 "requiring less rendezvous with control thread. Lower value " \ 263 "makes the pacing control less responsive to out-of-cycle allocs.")\ 264 range(0, 100) \ 265 \ 266 experimental(uintx, ShenandoahPacingCycleSlack, 10, \ 267 "Percent of free space taken as non-taxable allocations during " \ 268 "the GC cycle. Larger value makes the pacing milder at the " \ 269 "beginning of the GC cycle. Lower value makes the pacing less " \ 270 "uniform during the cycle.") \ 271 range(0, 100) \ 272 \ 273 experimental(double, ShenandoahPacingSurcharge, 1.1, \ 274 "Additional pacing tax surcharge to help unclutter the heap. " \ 275 "Larger values makes the pacing more aggressive. Lower values " \ 276 "risk GC cycles finish with less memory than were available at " \ 277 "the beginning of it.") \ 278 range(1.0, 100.0) \ 279 \ 280 experimental(uintx, ShenandoahCriticalFreeThreshold, 1, \ 281 "Percent of heap that needs to be free after recovery cycles, " \ 282 "either Degenerated or Full GC. If this much space is not " \ 283 "available, next recovery step would triggered.") \ 284 range(0, 100) \ 285 \ 286 diagnostic(bool, ShenandoahDegeneratedGC, true, \ 287 "Use Degenerated GC as the graceful degradation step. Disabling " \ 288 "this leads to degradation to Full GC") \ 289 \ 290 experimental(uintx, ShenandoahFullGCThreshold, 3, \ 291 "How many back-to-back Degenerated GCs to do before triggering " \ 292 "a Full GC.") \ 293 \ 294 experimental(bool, ShenandoahImplicitGCInvokesConcurrent, false, \ 295 "Should internally-caused GCs invoke concurrent cycles, or go to" \ 296 "stop-the-world (degenerated/full)?") \ 297 \ 298 diagnostic(bool, ShenandoahHumongousMoves, true, \ 299 "Allow moving humongous regions. This makes GC more resistant " \ 300 "to external fragmentation that may otherwise fail other " \ 301 "humongous allocations, at the expense of higher GC copying " \ 302 "costs. Currently affects stop-the-world (full) cycle only.") \ 303 \ 304 diagnostic(bool, ShenandoahOOMDuringEvacALot, false, \ 305 "Simulate OOM during evacuation frequently.") \ 306 \ 307 diagnostic(bool, ShenandoahAllocFailureALot, false, \ 308 "Make lots of artificial allocation failures.") \ 309 \ 310 diagnostic(bool, ShenandoahTerminationTrace, false, \ 311 "Tracing task termination timings") \ 312 \ 313 diagnostic(bool, ShenandoahAlwaysPreTouch, false, \ 314 "Pre-touch heap memory, overrides global AlwaysPreTouch") \ 315 \ 316 experimental(intx, ShenandoahMarkScanPrefetch, 32, \ 317 "How many objects to prefetch ahead when traversing mark bitmaps."\ 318 "Set to 0 to disable prefetching.") \ 319 range(0, 256) \ 320 \ 321 experimental(uintx, ShenandoahMarkLoopStride, 1000, \ 322 "How many items are processed during one marking step") \ 323 \ 324 experimental(uintx, ShenandoahParallelRegionStride, 1024, \ 325 "How many regions are processed in one stride during parallel " \ 326 "iteration.") \ 327 \ 328 experimental(size_t, ShenandoahSATBBufferSize, 1 * K, \ 329 "Number of entries in an SATB log buffer.") \ 330 range(1, max_uintx) \ 331 \ 332 experimental(uintx, ShenandoahSATBBufferFlushInterval, 100, \ 333 "Forcefully flush non-empty SATB buffers at this interval. " \ 334 "Time is in milliseconds.") \ 335 \ 336 experimental(uint, ShenandoahParallelSafepointThreads, 4, \ 337 "Number of parallel threads used for safepoint prolog/epilog") \ 338 \ 339 experimental(bool, ShenandoahPreclean, true, \ 340 "Do concurrent preclean phase before final mark: process " \ 341 "definitely alive references to avoid dealing with them during " \ 342 "pause.") \ 343 \ 344 experimental(bool, ShenandoahSuspendibleWorkers, false, \ 345 "Suspend concurrent GC worker threads at safepoints") \ 346 \ 347 diagnostic(bool, ShenandoahSATBBarrier, true, \ 348 "Turn on/off SATB barriers in Shenandoah") \ 349 \ 350 diagnostic(bool, ShenandoahKeepAliveBarrier, true, \ 351 "Turn on/off keep alive barriers in Shenandoah") \ 352 \ 353 diagnostic(bool, ShenandoahStoreValEnqueueBarrier, false, \ 354 "Turn on/off enqueuing of oops for storeval barriers") \ 355 \ 356 diagnostic(bool, ShenandoahCASBarrier, true, \ 357 "Turn on/off CAS barriers in Shenandoah") \ 358 \ 359 diagnostic(bool, ShenandoahCloneBarrier, true, \ 360 "Turn on/off clone barriers in Shenandoah") \ 361 \ 362 diagnostic(bool, ShenandoahLoadRefBarrier, true, \ 363 "Turn on/off load-reference barriers in Shenandoah") \ 364 \ 365 experimental(bool, ShenandoahConcurrentScanCodeRoots, true, \ 366 "Scan code roots concurrently, instead of during a pause") \ 367 \ 368 experimental(uintx, ShenandoahCodeRootsStyle, 2, \ 369 "Use this style to scan code cache:" \ 370 " 0 - sequential iterator;" \ 371 " 1 - parallel iterator;" \ 372 " 2 - parallel iterator with cset filters;") \ 373 \ 374 diagnostic(bool, ShenandoahOptimizeStaticFinals, true, \ 375 "Optimize barriers on static final fields. " \ 376 "Turn it off for maximum compatibility with reflection or JNI " \ 377 "code that manipulates final fields.") \ 378 \ 379 experimental(bool, ShenandoahCommonGCStateLoads, false, \ 380 "Enable commonming for GC state loads in generated code.") \ 381 \ 382 develop(bool, ShenandoahVerifyOptoBarriers, false, \ 383 "Verify no missing barriers in C2") \ 384 \ 385 experimental(bool, ShenandoahLoopOptsAfterExpansion, true, \ 386 "Attempt more loop opts after barrier expansion") \ 387 \ 388 diagnostic(bool, ShenandoahSelfFixing, true, \ 389 "Fix references with load reference barrier. Disabling this " \ 390 "might degrade performance.") \ 391 392 393 #endif // SHARE_VM_GC_SHENANDOAH_SHENANDOAH_GLOBALS_HPP