1 /* 2 * Copyright (c) 2016, 2018, 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 experimental(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 " *) passive - do not start concurrent GC, wait for Full GC; " \ 69 " *) aggressive - run concurrent GC continuously, evacuate " \ 70 " everything;" \ 71 " *) compact - run GC with lower footprint target, may end up " \ 72 " doing continuous GC, evacuate lots of live " \ 73 " objects, uncommit heap aggressively;") \ 74 \ 75 experimental(ccstr, ShenandoahUpdateRefsEarly, "adaptive", \ 76 "Run a separate concurrent reference updating phase after" \ 77 "concurrent evacuation. Possible values: 'on', 'off', 'adaptive'")\ 78 \ 79 experimental(uintx, ShenandoahRefProcFrequency, 5, \ 80 "How often should (weak, soft, etc) references be processed. " \ 81 "References get processed at every Nth GC cycle. Set to zero " \ 82 "to disable reference processing.") \ 83 \ 84 experimental(uintx, ShenandoahUnloadClassesFrequency, 5, \ 85 "How often should classes get unloaded. " \ 86 "Class unloading is performed at every Nth GC cycle. " \ 87 "Set to zero to disable class unloading during concurrent GC.") \ 88 \ 89 experimental(uintx, ShenandoahGarbageThreshold, 60, \ 90 "Sets the percentage of garbage a region need to contain before " \ 91 "it can be marked for collection. Does not apply to all " \ 92 "heuristics.") \ 93 range(0,100) \ 94 \ 95 experimental(uintx, ShenandoahFreeThreshold, 10, \ 96 "Set the percentage of free heap at which a GC cycle is started. "\ 97 "Does not apply to all 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 "Adaptive and dynamic heuristics would guarantee a GC cycle " \ 144 "at 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 \ 148 experimental(bool, ShenandoahAlwaysClearSoftRefs, false, \ 149 "Clear soft references always, instead of using any smart " \ 150 "cleanup policy. This minimizes footprint at expense of more " \ 151 "softref churn in applications.") \ 152 \ 153 experimental(bool, ShenandoahUncommit, true, \ 154 "Allow Shenandoah to uncommit unused memory.") \ 155 \ 156 experimental(uintx, ShenandoahUncommitDelay, 5*60*1000, \ 157 "Shenandoah would start to uncommit memory for regions that were" \ 158 " not used for more than this time. First use after that would " \ 159 "incur allocation stalls. Actively used regions would never be " \ 160 "uncommitted, because they never decay. Time is in milliseconds." \ 161 "Setting this delay to 0 effectively makes Shenandoah to " \ 162 "uncommit the regions almost immediately.") \ 163 \ 164 experimental(bool, ShenandoahRegionSampling, false, \ 165 "Turns on heap region sampling via JVMStat") \ 166 \ 167 experimental(int, ShenandoahRegionSamplingRate, 40, \ 168 "Sampling rate for heap region sampling. " \ 169 "Number of milliseconds between samples") \ 170 \ 171 experimental(uintx, ShenandoahControlIntervalMin, 1, \ 172 "The minumum sleep interval for control loop that drives " \ 173 "the cycles. Lower values would increase GC responsiveness " \ 174 "to changing heap conditions, at the expense of higher perf " \ 175 "overhead. Time is in milliseconds.") \ 176 \ 177 experimental(uintx, ShenandoahControlIntervalMax, 10, \ 178 "The maximum sleep interval for control loop that drives " \ 179 "the cycles. Lower values would increase GC responsiveness " \ 180 "to changing heap conditions, at the expense of higher perf " \ 181 "overhead. Time is in milliseconds.") \ 182 \ 183 experimental(uintx, ShenandoahControlIntervalAdjustPeriod, 1000, \ 184 "The time period for one step in control loop interval " \ 185 "adjustment. Lower values make adjustments faster, at the " \ 186 "expense of higher perf overhead. Time is in milliseconds.") \ 187 \ 188 diagnostic(bool, ShenandoahVerify, false, \ 189 "Verify the Shenandoah garbage collector") \ 190 \ 191 diagnostic(intx, ShenandoahVerifyLevel, 4, \ 192 "Shenandoah verification level: " \ 193 "0 = basic heap checks; " \ 194 "1 = previous level, plus basic region checks; " \ 195 "2 = previous level, plus all roots; " \ 196 "3 = previous level, plus all reachable objects; " \ 197 "4 = previous level, plus all marked objects") \ 198 \ 199 diagnostic(bool, ShenandoahElasticTLAB, true, \ 200 "Use Elastic TLABs with Shenandoah") \ 201 \ 202 diagnostic(bool, ShenandoahAllowMixedAllocs, true, \ 203 "Allow mixing mutator and collector allocations in a single " \ 204 "region") \ 205 \ 206 experimental(uintx, ShenandoahAllocSpikeFactor, 5, \ 207 "The amount of heap space to reserve for absorbing the " \ 208 "allocation spikes. Larger value wastes more memory in " \ 209 "non-emergency cases, but provides more safety in emergency " \ 210 "cases. In percents of total heap size.") \ 211 range(0,100) \ 212 \ 213 experimental(uintx, ShenandoahEvacReserve, 5, \ 214 "Maximum amount of free space to reserve for evacuation. " \ 215 "Larger values make GC more aggressive, while leaving less " \ 216 "headroom for application to allocate in. " \ 217 "In percents of total heap size.") \ 218 range(1,100) \ 219 \ 220 experimental(double, ShenandoahEvacWaste, 1.2, \ 221 "How much waste evacuations produce within the reserved " \ 222 "space. Larger values make evacuations more resilient " \ 223 "against allocation failures, at expense of smaller csets " \ 224 "on each cycle.") \ 225 range(1.0,100.0) \ 226 \ 227 experimental(bool, ShenandoahEvacReserveOverflow, true, \ 228 "Allow evacuations to overflow the reserved space. " \ 229 "Enabling it will make evacuations more resilient when " \ 230 "evacuation reserve/waste is incorrect, at the risk that " \ 231 "application allocations run out of memory too early.") \ 232 \ 233 diagnostic(bool, ShenandoahAllocationTrace, false, \ 234 "Trace allocation latencies and stalls. Can be expensive when " \ 235 "lots of allocations happen, and may introduce scalability " \ 236 "bottlenecks.") \ 237 \ 238 diagnostic(intx, ShenandoahAllocationStallThreshold, 10000, \ 239 "When allocation tracing is enabled, the allocation stalls " \ 240 "larger than this threshold would be reported as warnings. " \ 241 "Time is in microseconds.") \ 242 \ 243 experimental(uintx, ShenandoahEvacAssist, 10, \ 244 "How many objects to evacuate on WB assist path. " \ 245 "Use zero to disable.") \ 246 \ 247 experimental(bool, ShenandoahPacing, true, \ 248 "Pace application allocations to give GC chance to start " \ 249 "and complete before allocation failure is reached.") \ 250 \ 251 experimental(uintx, ShenandoahPacingMaxDelay, 10, \ 252 "Max delay for pacing application allocations. " \ 253 "Time is in milliseconds.") \ 254 \ 255 experimental(uintx, ShenandoahPacingIdleSlack, 2, \ 256 "Percent of heap counted as non-taxable allocations during idle. "\ 257 "Larger value makes the pacing milder during idle phases, " \ 258 "requiring less rendezvous with control thread. Lower value " \ 259 "makes the pacing control less responsive to out-of-cycle allocs.")\ 260 range(0, 100) \ 261 \ 262 experimental(uintx, ShenandoahPacingCycleSlack, 10, \ 263 "Percent of free space taken as non-taxable allocations during " \ 264 "the GC cycle. Larger value makes the pacing milder at the " \ 265 "beginning of the GC cycle. Lower value makes the pacing less " \ 266 "uniform during the cycle.") \ 267 range(0, 100) \ 268 \ 269 experimental(double, ShenandoahPacingSurcharge, 1.1, \ 270 "Additional pacing tax surcharge to help unclutter the heap. " \ 271 "Larger values makes the pacing more aggressive. Lower values " \ 272 "risk GC cycles finish with less memory than were available at " \ 273 "the beginning of it.") \ 274 range(1.0, 100.0) \ 275 \ 276 experimental(uintx, ShenandoahCriticalFreeThreshold, 1, \ 277 "Percent of heap that needs to be free after recovery cycles, " \ 278 "either Degenerated or Full GC. If this much space is not " \ 279 "available, next recovery step would triggered.") \ 280 range(0, 100) \ 281 \ 282 diagnostic(bool, ShenandoahDegeneratedGC, true, \ 283 "Use Degenerated GC as the graceful degradation step. Disabling " \ 284 "this leads to degradation to Full GC") \ 285 \ 286 experimental(uintx, ShenandoahFullGCThreshold, 3, \ 287 "How many back-to-back Degenerated GCs to do before triggering " \ 288 "a Full GC.") \ 289 \ 290 experimental(bool, ShenandoahImplicitGCInvokesConcurrent, false, \ 291 "Should internally-caused GCs invoke concurrent cycles, or go to" \ 292 "stop-the-world (degenerated/full)?") \ 293 \ 294 experimental(bool, ShenandoahHumongousMoves, true, \ 295 "Allow moving humongous regions. This makes GC more resistant " \ 296 "to external fragmentation that may otherwise fail other " \ 297 "humongous allocations, at the expense of higher GC copying " \ 298 "costs.") \ 299 \ 300 diagnostic(bool, ShenandoahOOMDuringEvacALot, false, \ 301 "Simulate OOM during evacuation frequently.") \ 302 \ 303 diagnostic(bool, ShenandoahAllocFailureALot, false, \ 304 "Make lots of artificial allocation failures.") \ 305 \ 306 diagnostic(bool, ShenandoahTerminationTrace, false, \ 307 "Tracing task termination timings") \ 308 \ 309 develop(bool, ShenandoahVerifyObjectEquals, false, \ 310 "Verify that == and != are not used on oops. Only in fastdebug") \ 311 \ 312 diagnostic(bool, ShenandoahAlwaysPreTouch, false, \ 313 "Pre-touch heap memory, overrides global AlwaysPreTouch") \ 314 \ 315 experimental(intx, ShenandoahMarkScanPrefetch, 32, \ 316 "How many objects to prefetch ahead when traversing mark bitmaps."\ 317 "Set to 0 to disable prefetching.") \ 318 range(0, 256) \ 319 \ 320 experimental(uintx, ShenandoahMarkLoopStride, 1000, \ 321 "How many items are processed during one marking step") \ 322 \ 323 experimental(uintx, ShenandoahParallelRegionStride, 1024, \ 324 "How many regions are processed in one stride during parallel " \ 325 "iteration.") \ 326 \ 327 experimental(size_t, ShenandoahSATBBufferSize, 1 * K, \ 328 "Number of entries in an SATB log buffer.") \ 329 range(1, max_uintx) \ 330 \ 331 experimental(uintx, ShenandoahSATBBufferFlushInterval, 100, \ 332 "Forcefully flush non-empty SATB buffers at this interval. " \ 333 "Time is in milliseconds.") \ 334 \ 335 experimental(uint, ShenandoahParallelSafepointThreads, 4, \ 336 "Number of parallel threads used for safepoint prolog/epilog") \ 337 \ 338 experimental(bool, ShenandoahPreclean, true, \ 339 "Do concurrent preclean phase before final mark: process " \ 340 "definitely alive references to avoid dealing with them during " \ 341 "pause.") \ 342 \ 343 experimental(bool, ShenandoahSuspendibleWorkers, false, \ 344 "Suspend concurrent GC worker threads at safepoints") \ 345 \ 346 diagnostic(bool, ShenandoahSATBBarrier, true, \ 347 "Turn on/off SATB barriers in Shenandoah") \ 348 \ 349 diagnostic(bool, ShenandoahKeepAliveBarrier, true, \ 350 "Turn on/off keep alive barriers in Shenandoah") \ 351 \ 352 diagnostic(bool, ShenandoahWriteBarrier, true, \ 353 "Turn on/off write barriers in Shenandoah") \ 354 \ 355 diagnostic(bool, ShenandoahReadBarrier, true, \ 356 "Turn on/off read barriers in Shenandoah") \ 357 \ 358 diagnostic(bool, ShenandoahStoreValEnqueueBarrier, false, \ 359 "Turn on/off enqueuing of oops for storeval barriers") \ 360 \ 361 diagnostic(bool, ShenandoahStoreValReadBarrier, true, \ 362 "Turn on/off store val read barriers in Shenandoah") \ 363 \ 364 diagnostic(bool, ShenandoahCASBarrier, true, \ 365 "Turn on/off CAS barriers in Shenandoah") \ 366 \ 367 diagnostic(bool, ShenandoahAcmpBarrier, true, \ 368 "Turn on/off acmp barriers in Shenandoah") \ 369 \ 370 diagnostic(bool, ShenandoahCloneBarrier, true, \ 371 "Turn on/off clone barriers in Shenandoah") \ 372 \ 373 diagnostic(bool, ShenandoahStoreCheck, false, \ 374 "Emit additional code that checks objects are written to only" \ 375 " in to-space") \ 376 \ 377 experimental(bool, ShenandoahConcurrentScanCodeRoots, true, \ 378 "Scan code roots concurrently, instead of during a pause") \ 379 \ 380 experimental(uintx, ShenandoahCodeRootsStyle, 2, \ 381 "Use this style to scan code cache:" \ 382 " 0 - sequential iterator;" \ 383 " 1 - parallel iterator;" \ 384 " 2 - parallel iterator with cset filters;") \ 385 \ 386 experimental(bool, ShenandoahOptimizeStaticFinals, true, \ 387 "Optimize barriers on static final fields. " \ 388 "Turn it off for maximum compatibility with reflection or JNI " \ 389 "code that manipulates final fields.") \ 390 \ 391 experimental(bool, ShenandoahOptimizeInstanceFinals, false, \ 392 "Optimize barriers on final instance fields." \ 393 "Turn it off for maximum compatibility with reflection or JNI " \ 394 "code that manipulates final fields.") \ 395 \ 396 experimental(bool, ShenandoahOptimizeStableFinals, false, \ 397 "Optimize barriers on stable fields." \ 398 "Turn it off for maximum compatibility with reflection or JNI " \ 399 "code that manipulates final fields.") \ 400 \ 401 diagnostic(bool, ShenandoahDecreaseRegisterPressure, false, \ 402 "Try to reuse after-barrier values to reduce register pressure") \ 403 \ 404 experimental(bool, ShenandoahCommonGCStateLoads, false, \ 405 "Enable commonming for GC state loads in generated code.") \ 406 \ 407 develop(bool, ShenandoahVerifyOptoBarriers, false, \ 408 "Verify no missing barriers in C2") \ 409 \ 410 experimental(bool, ShenandoahDontIncreaseWBFreq, true, \ 411 "Common 2 WriteBarriers or WriteBarrier and a ReadBarrier only " \ 412 "if the resulting WriteBarrier isn't executed more frequently") \ 413 \ 414 experimental(bool, ShenandoahLoopOptsAfterExpansion, true, \ 415 "Attempt more loop opts after write barrier expansion") \ 416 417 #endif // SHARE_VM_GC_SHENANDOAH_SHENANDOAH_GLOBALS_HPP