1 /*
  2  * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
  3  * Copyright (c) 2016, 2021, Red Hat, Inc. All rights reserved.
  4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  5  *
  6  * This code is free software; you can redistribute it and/or modify it
  7  * under the terms of the GNU General Public License version 2 only, as
  8  * published by the Free Software Foundation.
  9  *
 10  * This code is distributed in the hope that it will be useful, but WITHOUT
 11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 13  * version 2 for more details (a copy is included in the LICENSE file that
 14  * accompanied this code).
 15  *
 16  * You should have received a copy of the GNU General Public License version
 17  * 2 along with this work; if not, write to the Free Software Foundation,
 18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 19  *
 20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 21  * or visit www.oracle.com if you need additional information or have any
 22  * questions.
 23  *
 24  */
 25 
 26 #ifndef SHARE_GC_SHENANDOAH_SHENANDOAH_GLOBALS_HPP
 27 #define SHARE_GC_SHENANDOAH_SHENANDOAH_GLOBALS_HPP
 28 
 29 #define GC_SHENANDOAH_FLAGS(develop,                                        \
 30                             develop_pd,                                     \
 31                             product,                                        \
 32                             product_pd,                                     \
 33                             notproduct,                                     \
 34                             range,                                          \
 35                             constraint)                                     \
 36                                                                             \
 37   product(size_t, ShenandoahRegionSize, 0, EXPERIMENTAL,                    \
 38           "Static heap region size. Set zero to enable automatic sizing.")  \
 39                                                                             \
 40   product(size_t, ShenandoahTargetNumRegions, 2048, EXPERIMENTAL,           \
 41           "With automatic region sizing, this is the approximate number "   \
 42           "of regions that would be used, within min/max region size "      \
 43           "limits.")                                                        \
 44                                                                             \
 45   product(size_t, ShenandoahMinRegionSize, 256 * K, EXPERIMENTAL,           \
 46           "With automatic region sizing, the regions would be at least "    \
 47           "this large.")                                                    \
 48                                                                             \
 49   product(size_t, ShenandoahMaxRegionSize, 32 * M, EXPERIMENTAL,            \
 50           "With automatic region sizing, the regions would be at most "     \
 51           "this large.")                                                    \
 52                                                                             \
 53   product(intx, ShenandoahHumongousThreshold, 100, EXPERIMENTAL,            \
 54           "Humongous objects are allocated in separate regions. "           \
 55           "This setting defines how large the object should be to be "      \
 56           "deemed humongous. Value is in  percents of heap region size. "   \
 57           "This also caps the maximum TLAB size.")                          \
 58           range(1, 100)                                                     \
 59                                                                             \
 60   product(ccstr, ShenandoahGCMode, "satb",                                  \
 61           "GC mode to use.  Among other things, this defines which "        \
 62           "barriers are in in use. Possible values are:"                    \
 63           " satb - snapshot-at-the-beginning concurrent GC (three pass mark-evac-update);"  \
 64           " iu - incremental-update concurrent GC (three pass mark-evac-update);"  \
 65           " passive - stop the world GC only (either degenerated or full);" \
 66           " generational - generational concurrent GC")                     \
 67                                                                             \
 68   product(ccstr, ShenandoahGCHeuristics, "adaptive",                        \
 69           "GC heuristics to use. This fine-tunes the GC mode selected, "    \
 70           "by choosing when to start the GC, how much to process on each "  \
 71           "cycle, and what other features to automatically enable. "        \
 72           "Possible values are:"                                            \
 73           " adaptive - adapt to maintain the given amount of free heap "    \
 74           "at all times, even during the GC cycle;"                         \
 75           " static -  trigger GC when free heap falls below the threshold;" \
 76           " aggressive - run GC continuously, try to evacuate everything;"  \
 77           " compact - run GC more frequently and with deeper targets to "   \
 78           "free up more memory.")                                           \
 79                                                                             \
 80   product(ccstr, ShenandoahOldGCHeuristics, "adaptive",                     \
 81           "Similar to ShenandoahGCHeuristics, but applied to the old "      \
 82           "generation. This configuration is only used to trigger old "     \
 83           "collections and does not change how regions are selected "       \
 84           "for collection.")                                                \
 85                                                                             \
 86   product(uintx, ShenandoahUnloadClassesFrequency, 1, EXPERIMENTAL,         \
 87           "Unload the classes every Nth cycle. Normally affects concurrent "\
 88           "GC cycles, as degenerated and full GCs would try to unload "     \
 89           "classes regardless. Set to zero to disable class unloading.")    \
 90                                                                             \
 91   product(uintx, ShenandoahGarbageThreshold, 25, EXPERIMENTAL,              \
 92           "How much garbage a region has to contain before it would be "    \
 93           "taken for collection. This a guideline only, as GC heuristics "  \
 94           "may select the region for collection even if it has little "     \
 95           "garbage. This also affects how much internal fragmentation the " \
 96           "collector accepts. In percents of heap region size.")            \
 97           range(0,100)                                                      \
 98                                                                             \
 99   product(uintx, ShenandoahOldGarbageThreshold, 25, EXPERIMENTAL,           \
100           "How much garbage an old region has to contain before it would "  \
101           "be taken for collection.")                                       \
102           range(0,100)                                                      \
103                                                                             \
104   product(uintx, ShenandoahIgnoreGarbageThreshold, 5, EXPERIMENTAL,         \
105           "When less than this amount of garbage (as a percentage of "      \
106           "region size) exists within a region, the region will not be "    \
107           "added to the collection set, even when the heuristic has "       \
108           "chosen to aggressively add regions with less than "              \
109           "ShenandoahGarbageThreshold amount of garbage into the "          \
110           "collection set.")                                                \
111           range(0,100)                                                      \
112                                                                             \
113   product(uintx, ShenandoahInitFreeThreshold, 70, EXPERIMENTAL,             \
114           "When less than this amount of memory is free within the"         \
115           "heap or generation, trigger a learning cycle if we are "         \
116           "in learning mode.  Learning mode happens during initialization " \
117           "and following a drastic state change, such as following a "      \
118           "degenerated or Full GC cycle.  In percents of soft max "         \
119           "heap size.")                                                     \
120           range(0,100)                                                      \
121                                                                             \
122   product(uintx, ShenandoahMinFreeThreshold, 10, EXPERIMENTAL,              \
123           "Percentage of free heap memory (or young generation, in "        \
124           "generational mode) below which most heuristics trigger "         \
125           "collection independent of other triggers. Provides a safety "    \
126           "margin for many heuristics. In percents of (soft) max heap "     \
127           "size.")                                                          \
128           range(0,100)                                                      \
129                                                                             \
130   product(uintx, ShenandoahOldMinFreeThreshold, 5, EXPERIMENTAL,            \
131           "Percentage of free old generation heap memory below which most " \
132           "heuristics trigger collection independent of other triggers. "   \
133           "Provides a safety margin for many heuristics. In percents of "   \
134           "(soft) max heap size.")                                          \
135           range(0,100)                                                      \
136                                                                             \
137   product(uintx, ShenandoahAllocationThreshold, 0, EXPERIMENTAL,            \
138           "How many new allocations should happen since the last GC cycle " \
139           "before some heuristics trigger the collection. In percents of "  \
140           "(soft) max heap size. Set to zero to effectively disable.")      \
141           range(0,100)                                                      \
142                                                                             \
143   product(uintx, ShenandoahAllocSpikeFactor, 5, EXPERIMENTAL,               \
144           "How much of heap should some heuristics reserve for absorbing "  \
145           "the allocation spikes. Larger value wastes more memory in "      \
146           "non-emergency cases, but provides more safety in emergency "     \
147           "cases. In percents of (soft) max heap size.")                    \
148           range(0,100)                                                      \
149                                                                             \
150   product(uintx, ShenandoahLearningSteps, 5, EXPERIMENTAL,                  \
151           "The number of cycles some heuristics take to collect in order "  \
152           "to learn application and GC performance.")                       \
153           range(0,100)                                                      \
154                                                                             \
155   product(uintx, ShenandoahImmediateThreshold, 90, EXPERIMENTAL,            \
156           "The cycle may shortcut when enough garbage can be reclaimed "    \
157           "from the immediate garbage (completely garbage regions). "       \
158           "In percents of total garbage found. Setting this threshold "     \
159           "to 100 effectively disables the shortcut.")                      \
160           range(0,100)                                                      \
161                                                                             \
162   product(uintx, ShenandoahAdaptiveSampleFrequencyHz, 10, EXPERIMENTAL,     \
163           "The number of times per second to update the allocation rate "   \
164           "moving average.")                                                \
165                                                                             \
166   product(uintx, ShenandoahAdaptiveSampleSizeSeconds, 10, EXPERIMENTAL,     \
167           "The size of the moving window over which the average "           \
168           "allocation rate is maintained. The total number of samples "     \
169           "is the product of this number and the sample frequency.")        \
170                                                                             \
171   product(double, ShenandoahAdaptiveInitialConfidence, 1.8, EXPERIMENTAL,   \
172           "The number of standard deviations used to determine an initial " \
173           "margin of error for the average cycle time and average "         \
174           "allocation rate. Increasing this value will cause the "          \
175           "heuristic to initiate more concurrent cycles." )                 \
176                                                                             \
177   product(double, ShenandoahAdaptiveInitialSpikeThreshold, 1.8, EXPERIMENTAL, \
178           "If the most recently sampled allocation rate is more than "      \
179           "this many standard deviations away from the moving average, "    \
180           "then a cycle is initiated. This value controls how sensitive "   \
181           "the heuristic is to allocation spikes. Decreasing this number "  \
182           "increases the sensitivity. ")                                    \
183                                                                             \
184   product(double, ShenandoahAdaptiveDecayFactor, 0.5, EXPERIMENTAL,         \
185           "The decay factor (alpha) used for values in the weighted "       \
186           "moving average of cycle time and allocation rate. "              \
187           "Larger values give more weight to recent values.")               \
188           range(0,1.0)                                                      \
189                                                                             \
190   product(bool, ShenandoahAdaptiveIgnoreShortCycles, true, EXPERIMENTAL,    \
191           "The adaptive heuristic tracks a moving average of cycle "        \
192           "times in order to start a gc before memory is exhausted. "       \
193           "In some cases, Shenandoah may skip the evacuation and update "   \
194           "reference phases, resulting in a shorter cycle. These may skew " \
195           "the average cycle time downward and may cause the heuristic "    \
196           "to wait too long to start a cycle. Disabling this will have "    \
197           "the gc run less often, which will reduce CPU utilization, but"   \
198           "increase the risk of degenerated cycles.")                       \
199                                                                             \
200   product(uintx, ShenandoahGuaranteedGCInterval, 5*60*1000, EXPERIMENTAL,   \
201           "Many heuristics would guarantee a concurrent GC cycle at "       \
202           "least with this interval. This is useful when large idle "       \
203           "intervals are present, where GC can run without stealing "       \
204           "time from active application. Time is in milliseconds. "         \
205           "Setting this to 0 disables the feature.")                        \
206                                                                             \
207   product(uintx, ShenandoahGuaranteedOldGCInterval, 10*60*1000,  EXPERIMENTAL,  \
208           "Run a collection of the old generation at least this often. "    \
209           "Heuristics may trigger collections more frequently. Time is in " \
210           "milliseconds. Setting this to 0 disables the feature.")          \
211                                                                             \
212   product(uintx, ShenandoahGuaranteedYoungGCInterval, 5*60*1000,  EXPERIMENTAL,  \
213           "Run a collection of the young generation at least this often. "    \
214           "Heuristics may trigger collections more frequently. Time is in " \
215           "milliseconds. Setting this to 0 disables the feature.")          \
216                                                                             \
217   product(bool, ShenandoahAlwaysClearSoftRefs, false, EXPERIMENTAL,         \
218           "Unconditionally clear soft references, instead of using any "    \
219           "other cleanup policy. This minimizes footprint at expense of"    \
220           "more soft reference churn in applications.")                     \
221                                                                             \
222   product(bool, ShenandoahUncommit, true, EXPERIMENTAL,                     \
223           "Allow to uncommit memory under unused regions and metadata. "    \
224           "This optimizes footprint at expense of allocation latency in "   \
225           "regions that require committing back. Uncommits would be "       \
226           "disabled by some heuristics, or with static heap size.")         \
227                                                                             \
228   product(uintx, ShenandoahUncommitDelay, 5*60*1000, EXPERIMENTAL,          \
229           "Uncommit memory for regions that were not used for more than "   \
230           "this time. First use after that would incur allocation stalls. " \
231           "Actively used regions would never be uncommitted, because they " \
232           "do not become unused longer than this delay. Time is in "        \
233           "milliseconds. Setting this delay to 0 effectively uncommits "    \
234           "regions almost immediately after they become unused.")           \
235                                                                             \
236   product(bool, ShenandoahRegionSampling, false, EXPERIMENTAL,              \
237           "Provide heap region sampling data via jvmstat.")                 \
238                                                                             \
239   product(int, ShenandoahRegionSamplingRate, 40, EXPERIMENTAL,              \
240           "Sampling rate for heap region sampling. In milliseconds between "\
241           "the samples. Higher values provide more fidelity, at expense "   \
242           "of more sampling overhead.")                                     \
243                                                                             \
244   product(ccstr, ShenandoahRegionSamplingFile,                              \
245           "./shenandoahSnapshots_pid%p.log",                                \
246           "If ShenandoahLogRegionSampling is on, save sampling data stream "\
247           "to this file [default: ./shenandoahSnapshots_pid%p.log] "        \
248           "(%p replaced with pid)")                                         \
249                                                                             \
250   product(uintx, ShenandoahControlIntervalMin, 1, EXPERIMENTAL,             \
251           "The minimum sleep interval for the control loop that drives "    \
252           "the cycles. Lower values would increase GC responsiveness "      \
253           "to changing heap conditions, at the expense of higher perf "     \
254           "overhead. Time is in milliseconds.")                             \
255                                                                             \
256   product(uintx, ShenandoahControlIntervalMax, 10, EXPERIMENTAL,            \
257           "The maximum sleep interval for control loop that drives "        \
258           "the cycles. Lower values would increase GC responsiveness "      \
259           "to changing heap conditions, at the expense of higher perf "     \
260           "overhead. Time is in milliseconds.")                             \
261                                                                             \
262   product(uintx, ShenandoahControlIntervalAdjustPeriod, 1000, EXPERIMENTAL, \
263           "The time period for one step in control loop interval "          \
264           "adjustment. Lower values make adjustments faster, at the "       \
265           "expense of higher perf overhead. Time is in milliseconds.")      \
266                                                                             \
267   product(bool, ShenandoahVerify, false, DIAGNOSTIC,                        \
268           "Enable internal verification. This would catch many GC bugs, "   \
269           "but it would also stall the collector during the verification, " \
270           "which prolongs the pauses and might hide other bugs.")           \
271                                                                             \
272   product(intx, ShenandoahVerifyLevel, 4, DIAGNOSTIC,                       \
273           "Verification level, higher levels check more, taking more time. "\
274           "Accepted values are:"                                            \
275           " 0 = basic heap checks; "                                        \
276           " 1 = previous level, plus basic region checks; "                 \
277           " 2 = previous level, plus all roots; "                           \
278           " 3 = previous level, plus all reachable objects; "               \
279           " 4 = previous level, plus all marked objects")                   \
280                                                                             \
281   product(bool, ShenandoahElasticTLAB, true, DIAGNOSTIC,                    \
282           "Use Elastic TLABs with Shenandoah")                              \
283                                                                             \
284   product(bool, ShenandoahUsePLAB, true, DIAGNOSTIC,                        \
285           "Use PLABs for object promotions with Shenandoah, "               \
286           "if in generational mode and UseTLAB is also set.")               \
287                                                                             \
288   product(uintx, ShenandoahEvacReserve, 5, EXPERIMENTAL,                    \
289           "How much of (young-generation) heap to reserve for "             \
290           "(young-generation) evacuations.  Larger values allow GC to "     \
291           "evacuate more live objects on every cycle, while leaving "       \
292           "less headroom for application to allocate while GC is "          \
293           "evacuating and updating references. This parameter is "          \
294           "consulted at the of marking, before selecting the collection "   \
295           "set.  If available memory at this time is smaller than the "     \
296           "indicated reserve, the bound on collection set size is "         \
297           "adjusted downward.  The size of a generational mixed "           \
298           "evacuation collection set (comprised of both young and old "     \
299           "regions) is also bounded by this parameter.  In percents of "    \
300           "total (young-generation) heap size.")                            \
301           range(1,100)                                                      \
302                                                                             \
303   product(double, ShenandoahEvacWaste, 1.2, EXPERIMENTAL,                   \
304           "How much waste evacuations produce within the reserved space. "  \
305           "Larger values make evacuations more resilient against "          \
306           "evacuation conflicts, at expense of evacuating less on each "    \
307           "GC cycle.  Smaller values increase the risk of evacuation "      \
308           "failures, which will trigger stop-the-world Full GC passes.")    \
309           range(1.0,100.0)                                                  \
310                                                                             \
311   product(double, ShenandoahGenerationalEvacWaste, 2.0, EXPERIMENTAL,       \
312           "For generational mode, how much waste evacuations produce "      \
313           "within the reserved space.  Larger values make evacuations "     \
314           "more resilient against evacuation conflicts, at expense of "     \
315           "evacuating less on each GC cycle.  Smaller values increase "     \
316           "the risk of evacuation failures, which will trigger "            \
317           "stop-the-world Full GC passes.  The default value for "          \
318           "generational mode is 2.0.  The reason for the higher default "   \
319           "value in generational mode is because generational mode "        \
320           "enforces the evacuation budget, triggering degenerated GC "      \
321           "which upgrades to full GC whenever the budget is exceeded.")     \
322           range(1.0,100.0)                                                  \
323                                                                             \
324   product(uintx, ShenandoahMaxEvacLABRatio, 16, EXPERIMENTAL,               \
325           "Potentially, each running thread maintains a PLAB for "          \
326           "evacuating objects into old-gen memory and a GCLAB for "         \
327           "evacuating objects into young-gen memory.  Each time a thread "  \
328           "exhausts its PLAB or GCLAB, a new local buffer is allocated. "   \
329           "By default, the new buffer is twice the size of the previous "   \
330           "buffer.  The sizes are reset to the minimum at the start of "    \
331           "each GC pass.  This parameter limits the growth of evacuation "  \
332           "buffer sizes to its value multiplied by the minimum buffer "     \
333           "size.  A higher value allows evacuation allocations to be more " \
334           "efficient because less synchronization is required by "          \
335           "individual threads.  However, a larger value increases the "     \
336           "likelihood of evacuation failures, leading to long "             \
337           "stop-the-world pauses.  This is because a large value "          \
338           "allows individual threads to consume large percentages of "      \
339           "the total evacuation budget without necessarily effectively "    \
340           "filling their local evcauation buffers with evacuated "          \
341           "objects.  A value of zero means no maximum size is enforced.")   \
342           range(0, 1024)                                                    \
343                                                                             \
344   product(bool, ShenandoahEvacReserveOverflow, true, EXPERIMENTAL,          \
345           "Allow evacuations to overflow the reserved space. Enabling it "  \
346           "will make evacuations more resilient when evacuation "           \
347           "reserve/waste is incorrect, at the risk that application "       \
348           "runs out of memory too early.")                                  \
349                                                                             \
350   product(uintx, ShenandoahOldEvacReserve, 2, EXPERIMENTAL,                 \
351           "How much of old-generation heap to reserve for old-generation "  \
352           "evacuations.  Larger values allow GC to evacuate more live "     \
353           "old-generation objects on every cycle, while potentially "       \
354           "creating greater impact on the cadence at which the young- "     \
355           "generation allocation pool is replenished.  During mixed "       \
356           "evacuations, the bound on amount of old-generation heap "        \
357           "regions included in the collecdtion set is the smaller "         \
358           "of the quantities specified by this parameter and the "          \
359           "size of ShenandoahEvacReserve as adjusted by the value of "      \
360           "ShenandoahOldEvacRatioPercent.  In percents of total "           \
361           "old-generation heap size.")                                      \
362           range(1,100)                                                      \
363                                                                             \
364   product(uintx, ShenandoahOldEvacRatioPercent, 12, EXPERIMENTAL,           \
365           "The maximum proportion of evacuation from old-gen memory, as "   \
366           "a percent ratio.  The default value 12 denotes that no more "    \
367           "than one eighth (12%) of the collection set evacuation "         \
368           "workload may be comprised of old-gen heap regions.  A larger "   \
369           "value allows a smaller number of mixed evacuations to process "  \
370           "the entire list of old-gen collection candidates at the cost "   \
371           "of an increased disruption of the normal cadence of young-gen "  \
372           "collections.  A value of 100 allows a mixed evacuation to "      \
373           "focus entirely on old-gen memory, allowing no young-gen "        \
374           "regions to be collected, likely resulting in subsequent "        \
375           "allocation failures because the allocation pool is not "         \
376           "replenished.  A value of 0 allows a mixed evacuation to"         \
377           "focus entirely on young-gen memory, allowing no old-gen "        \
378           "regions to be collected, likely resulting in subsequent "        \
379           "promotion failures and triggering of stop-the-world full GC "    \
380           "events.")                                                        \
381           range(0,100)                                                      \
382                                                                             \
383   product(bool, ShenandoahPacing, true, EXPERIMENTAL,                       \
384           "Pace application allocations to give GC chance to start "        \
385           "and complete before allocation failure is reached.")             \
386                                                                             \
387   product(uintx, ShenandoahPacingMaxDelay, 10, EXPERIMENTAL,                \
388           "Max delay for pacing application allocations. Larger values "    \
389           "provide more resilience against out of memory, at expense at "   \
390           "hiding the GC latencies in the allocation path. Time is in "     \
391           "milliseconds. Setting it to arbitrarily large value makes "      \
392           "GC effectively stall the threads indefinitely instead of going " \
393           "to degenerated or Full GC.")                                     \
394                                                                             \
395   product(uintx, ShenandoahPacingIdleSlack, 2, EXPERIMENTAL,                \
396           "How much of heap counted as non-taxable allocations during idle "\
397           "phases. Larger value makes the pacing milder when collector is " \
398           "idle, requiring less rendezvous with control thread. Lower "     \
399           "value makes the pacing control less responsive to out-of-cycle " \
400           "allocs. In percent of total heap size.")                         \
401           range(0, 100)                                                     \
402                                                                             \
403   product(uintx, ShenandoahPacingCycleSlack, 10, EXPERIMENTAL,              \
404           "How much of free space to take as non-taxable allocations "      \
405           "the GC cycle. Larger value makes the pacing milder at the "      \
406           "beginning of the GC cycle. Lower value makes the pacing less "   \
407           "uniform during the cycle. In percent of free space.")            \
408           range(0, 100)                                                     \
409                                                                             \
410   product(double, ShenandoahPacingSurcharge, 1.1, EXPERIMENTAL,             \
411           "Additional pacing tax surcharge to help unclutter the heap. "    \
412           "Larger values makes the pacing more aggressive. Lower values "   \
413           "risk GC cycles finish with less memory than were available at "  \
414           "the beginning of it.")                                           \
415           range(1.0, 100.0)                                                 \
416                                                                             \
417   product(uintx, ShenandoahCriticalFreeThreshold, 1, EXPERIMENTAL,          \
418           "How much of the heap needs to be free after recovery cycles, "   \
419           "either Degenerated or Full GC to be claimed successful. If this "\
420           "much space is not available, next recovery step would be "       \
421           "triggered.")                                                     \
422           range(0, 100)                                                     \
423                                                                             \
424   product(bool, ShenandoahDegeneratedGC, true, DIAGNOSTIC,                  \
425           "Enable Degenerated GC as the graceful degradation step. "        \
426           "Disabling this option leads to degradation to Full GC instead. " \
427           "When running in passive mode, this can be toggled to measure "   \
428           "either Degenerated GC or Full GC costs.")                        \
429                                                                             \
430   product(uintx, ShenandoahFullGCThreshold, 3, EXPERIMENTAL,                \
431           "How many back-to-back Degenerated GCs should happen before "     \
432           "going to a Full GC.")                                            \
433                                                                             \
434   product(bool, ShenandoahImplicitGCInvokesConcurrent, false, EXPERIMENTAL, \
435           "Should internally-caused GC requests invoke concurrent cycles, " \
436           "should they do the stop-the-world (Degenerated / Full GC)? "     \
437           "Many heuristics automatically enable this. This option is "      \
438           "similar to global ExplicitGCInvokesConcurrent.")                 \
439                                                                             \
440   product(bool, ShenandoahHumongousMoves, true, DIAGNOSTIC,                 \
441           "Allow moving humongous regions. This makes GC more resistant "   \
442           "to external fragmentation that may otherwise fail other "        \
443           "humongous allocations, at the expense of higher GC copying "     \
444           "costs. Currently affects stop-the-world (Full) cycle only.")     \
445                                                                             \
446   product(bool, ShenandoahOOMDuringEvacALot, false, DIAGNOSTIC,             \
447           "Testing: simulate OOM during evacuation.")                       \
448                                                                             \
449   product(bool, ShenandoahAllocFailureALot, false, DIAGNOSTIC,              \
450           "Testing: make lots of artificial allocation failures.")          \
451                                                                             \
452   product(intx, ShenandoahMarkScanPrefetch, 32, EXPERIMENTAL,               \
453           "How many objects to prefetch ahead when traversing mark bitmaps."\
454           "Set to 0 to disable prefetching.")                               \
455           range(0, 256)                                                     \
456                                                                             \
457   product(uintx, ShenandoahMarkLoopStride, 1000, EXPERIMENTAL,              \
458           "How many items to process during one marking iteration before "  \
459           "checking for cancellation, yielding, etc. Larger values improve "\
460           "marking performance at expense of responsiveness.")              \
461                                                                             \
462   product(uintx, ShenandoahParallelRegionStride, 1024, EXPERIMENTAL,        \
463           "How many regions to process at once during parallel region "     \
464           "iteration. Affects heaps with lots of regions.")                 \
465                                                                             \
466   product(size_t, ShenandoahSATBBufferSize, 1 * K, EXPERIMENTAL,            \
467           "Number of entries in an SATB log buffer.")                       \
468           range(1, max_uintx)                                               \
469                                                                             \
470   product(uintx, ShenandoahMaxSATBBufferFlushes, 5, EXPERIMENTAL,           \
471           "How many times to maximum attempt to flush SATB buffers at the " \
472           "end of concurrent marking.")                                     \
473                                                                             \
474   product(bool, ShenandoahSuspendibleWorkers, false, EXPERIMENTAL,          \
475           "Suspend concurrent GC worker threads at safepoints")             \
476                                                                             \
477   product(bool, ShenandoahSATBBarrier, true, DIAGNOSTIC,                    \
478           "Turn on/off SATB barriers in Shenandoah")                        \
479                                                                             \
480   product(bool, ShenandoahIUBarrier, false, DIAGNOSTIC,                     \
481           "Turn on/off I-U barriers barriers in Shenandoah")                \
482                                                                             \
483   product(bool, ShenandoahCASBarrier, true, DIAGNOSTIC,                     \
484           "Turn on/off CAS barriers in Shenandoah")                         \
485                                                                             \
486   product(bool, ShenandoahCloneBarrier, true, DIAGNOSTIC,                   \
487           "Turn on/off clone barriers in Shenandoah")                       \
488                                                                             \
489   product(bool, ShenandoahLoadRefBarrier, true, DIAGNOSTIC,                 \
490           "Turn on/off load-reference barriers in Shenandoah")              \
491                                                                             \
492   product(bool, ShenandoahNMethodBarrier, true, DIAGNOSTIC,                 \
493           "Turn on/off NMethod entry barriers in Shenandoah")               \
494                                                                             \
495   product(bool, ShenandoahStackWatermarkBarrier, true, DIAGNOSTIC,          \
496           "Turn on/off stack watermark barriers in Shenandoah")             \
497                                                                             \
498   develop(bool, ShenandoahVerifyOptoBarriers, false,                        \
499           "Verify no missing barriers in C2.")                              \
500                                                                             \
501   product(bool, ShenandoahLoopOptsAfterExpansion, true, DIAGNOSTIC,         \
502           "Attempt more loop opts after barrier expansion.")                \
503                                                                             \
504   product(bool, ShenandoahSelfFixing, true, DIAGNOSTIC,                     \
505           "Fix references with load reference barrier. Disabling this "     \
506           "might degrade performance.")                                     \
507                                                                             \
508   product(uintx, ShenandoahBorrowPercent, 30, EXPERIMENTAL,                 \
509           "During evacuation and reference updating in generational "       \
510           "mode, new allocations are allowed to borrow from old-gen "       \
511           "memory up to ShenandoahBorrowPercent / 100 amount of the "       \
512           "young-generation content of the current collection set.  "       \
513           "Any memory borrowed from old-gen during evacuation and "         \
514           "update-references phases of GC will be repaid from the "         \
515           "abundance of young-gen memory produced when the collection "     \
516           "set is recycled at the end of updating references.  The "        \
517           "default value of 30 reserves 70% of the to-be-reclaimed "        \
518           "young collection set memory to be allocated during the "         \
519           "subsequent concurrent mark phase of GC.")                        \
520           range(0, 100)                                                     \
521                                                                             \
522   product(uintx, ShenandoahOldCompactionReserve, 8, EXPERIMENTAL,           \
523           "During generational GC, prevent promotions from filling "        \
524           "this number of heap regions.  These regions are reserved "       \
525           "for the purpose of supporting compaction of old-gen "            \
526           "memory.  Otherwise, old-gen memory cannot be compacted.")        \
527           range(0, 128)                                                     \
528                                                                             \
529   product(bool, ShenandoahPromoteTenuredObjects, true, DIAGNOSTIC,          \
530           "Turn on/off evacuating individual tenured young objects "        \
531           " to the old generation.")                                        \
532                                                                             \
533   product(bool, ShenandoahAllowOldMarkingPreemption, true, DIAGNOSTIC,      \
534           "Allow young generation collections to suspend concurrent"        \
535           " marking in the old generation.")                                \
536                                                                             \
537   product(uintx, ShenandoahAgingCyclePeriod, 1, EXPERIMENTAL,               \
538           "With generational mode, increment the age of objects and"        \
539           "regions each time this many young-gen GC cycles are completed.")
540  // end of GC_SHENANDOAH_FLAGS
541 
542 #endif // SHARE_GC_SHENANDOAH_SHENANDOAH_GLOBALS_HPP