1 /*
  2  * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
  3  * Copyright (c) 2016, 2021, Red Hat, Inc. All rights reserved.
  4  * Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
  5  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  6  *
  7  * This code is free software; you can redistribute it and/or modify it
  8  * under the terms of the GNU General Public License version 2 only, as
  9  * published by the Free Software Foundation.
 10  *
 11  * This code is distributed in the hope that it will be useful, but WITHOUT
 12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 14  * version 2 for more details (a copy is included in the LICENSE file that
 15  * accompanied this code).
 16  *
 17  * You should have received a copy of the GNU General Public License version
 18  * 2 along with this work; if not, write to the Free Software Foundation,
 19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 20  *
 21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 22  * or visit www.oracle.com if you need additional information or have any
 23  * questions.
 24  *
 25  */
 26 
 27 #ifndef SHARE_GC_SHENANDOAH_SHENANDOAH_GLOBALS_HPP
 28 #define SHARE_GC_SHENANDOAH_SHENANDOAH_GLOBALS_HPP
 29 
 30 #define GC_SHENANDOAH_FLAGS(develop,                                        \
 31                             develop_pd,                                     \
 32                             product,                                        \
 33                             product_pd,                                     \
 34                             range,                                          \
 35                             constraint)                                     \
 36                                                                             \
 37   product(uintx, ShenandoahGenerationalMinPIPUsage, 30, EXPERIMENTAL,       \
 38           "(Generational mode only) What percent of a heap region "         \
 39           "should be used before we consider promoting a region in "        \
 40           "place?  Regions with less than this amount of used will "        \
 41           "promoted by evacuation.  A benefit of promoting in place "       \
 42           "is that less work is required by the GC at the time the "        \
 43           "region is promoted.  A disadvantage of promoting in place "      \
 44           "is that this introduces fragmentation of old-gen memory, "       \
 45           "with old-gen regions scattered throughout the heap.  Regions "   \
 46           "that have been promoted in place may need to be evacuated at "   \
 47           "a later time in order to compact old-gen memory to enable "      \
 48           "future humongous allocations.")                                  \
 49           range(0,100)                                                      \
 50                                                                             \
 51   product(uintx, ShenandoahGenerationalHumongousReserve, 0, EXPERIMENTAL,   \
 52           "(Generational mode only) What percent of the heap should be "    \
 53           "reserved for humongous objects if possible.  Old-generation "    \
 54           "collections will endeavor to evacuate old-gen regions within "   \
 55           "this reserved area even if these regions do not contain high "   \
 56           "percentage of garbage.  Setting a larger value will cause "      \
 57           "more frequent old-gen collections.  A smaller value will "       \
 58           "increase the likelihood that humongous object allocations "      \
 59           "fail, resulting in stop-the-world full GCs.")                    \
 60           range(0,100)                                                      \
 61                                                                             \
 62   product(double, ShenandoahMinOldGenGrowthPercent, 50, EXPERIMENTAL,       \
 63           "(Generational mode only) If the usage within old generation "    \
 64           "has grown by at least this percent of its live memory size "     \
 65           "at the start of the previous old-generation marking effort, "    \
 66           "heuristics may trigger the start of a new old-gen collection.")  \
 67           range(0.0,100.0)                                                  \
 68                                                                             \
 69   product(double, ShenandoahMinOldGenGrowthRemainingHeapPercent,            \
 70           35, EXPERIMENTAL,                                                 \
 71           "(Generational mode only) If the usage within old generation "    \
 72           "has grown to exceed this percent of the remaining heap that "    \
 73           "was not marked live within the old generation at the time "      \
 74           "of the last old-generation marking effort, heuristics may "      \
 75           "trigger the start of a new old-gen collection.  Setting "        \
 76           "this value to a smaller value may cause back-to-back old "       \
 77           "generation marking triggers, since the typical memory used "     \
 78           "by the old generation is about 30% larger than the live "        \
 79           "memory contained within the old generation (because default "    \
 80           "value of ShenandoahOldGarbageThreshold is 25.")                  \
 81           range(0.0,100.0)                                                  \
 82                                                                             \
 83   product(uintx, ShenandoahIgnoreOldGrowthBelowPercentage,                  \
 84           40, EXPERIMENTAL,                                                 \
 85           "(Generational mode only) If the total usage of the old "         \
 86           "generation is smaller than this percent, we do not trigger "     \
 87           "old gen collections even if old has grown, except when "         \
 88           "ShenandoahGenerationalDoNotIgnoreGrowthAfterYoungCycles "        \
 89           "consecutive cycles have been completed following the "           \
 90           "preceding old-gen collection.")                                  \
 91           range(0,100)                                                      \
 92                                                                             \
 93   product(uintx, ShenandoahDoNotIgnoreGrowthAfterYoungCycles,               \
 94           100, EXPERIMENTAL,                                                \
 95           "(Generational mode only) Trigger an old-generation mark "        \
 96           "if old has grown and this many consecutive young-gen "           \
 97           "collections have been completed following the preceding "        \
 98           "old-gen collection.  We perform this old-generation mark "       \
 99           "evvort even if the usage of old generation is below "            \
100           "ShenandoahIgnoreOldGrowthBelowPercentage.")                      \
101                                                                             \
102   product(bool, ShenandoahGenerationalAdaptiveTenuring, true, EXPERIMENTAL, \
103           "(Generational mode only) Dynamically adapt tenuring age.")       \
104                                                                             \
105   product(bool, ShenandoahGenerationalCensusIgnoreOlderCohorts, true,       \
106                                                                EXPERIMENTAL,\
107           "(Generational mode only) Ignore mortality rates older than the " \
108           "oldest cohort under the tenuring age for the last cycle." )      \
109                                                                             \
110   product(uintx, ShenandoahGenerationalMinTenuringAge, 1, EXPERIMENTAL,     \
111           "(Generational mode only) Floor for adaptive tenuring age. "      \
112           "Setting floor and ceiling to the same value fixes the tenuring " \
113           "age; setting both to 1 simulates a poor approximation to "       \
114           "AlwaysTenure, and setting both to 16 simulates NeverTenure.")    \
115           range(1,16)                                                       \
116                                                                             \
117   product(uintx, ShenandoahGenerationalMaxTenuringAge, 15, EXPERIMENTAL,    \
118           "(Generational mode only) Ceiling for adaptive tenuring age. "    \
119           "Setting floor and ceiling to the same value fixes the tenuring " \
120           "age; setting both to 1 simulates a poor approximation to "       \
121           "AlwaysTenure, and setting both to 16 simulates NeverTenure.")    \
122           range(1,16)                                                       \
123                                                                             \
124   product(double, ShenandoahGenerationalTenuringMortalityRateThreshold,     \
125                                                          0.1, EXPERIMENTAL, \
126           "(Generational mode only) Cohort mortality rates below this "     \
127           "value will be treated as indicative of longevity, leading to "   \
128           "tenuring. A lower value delays tenuring, a higher value hastens "\
129           "it. Used only when ShenandoahGenerationalhenAdaptiveTenuring is "\
130           "enabled.")                                                       \
131           range(0.001,0.999)                                                \
132                                                                             \
133   product(size_t, ShenandoahGenerationalTenuringCohortPopulationThreshold,  \
134                                                          4*K, EXPERIMENTAL, \
135           "(Generational mode only) Cohorts whose population is lower than "\
136           "this value in the previous census are ignored wrt tenuring "     \
137           "decisions. Effectively this makes then tenurable as soon as all "\
138           "older cohorts are. Set this value to the largest cohort "        \
139           "population volume that you are comfortable ignoring when making "\
140           "tenuring decisions.")                                            \
141                                                                             \
142   product(size_t, ShenandoahRegionSize, 0, EXPERIMENTAL,                    \
143           "Static heap region size. Set zero to enable automatic sizing.")  \
144                                                                             \
145   product(size_t, ShenandoahTargetNumRegions, 2048, EXPERIMENTAL,           \
146           "With automatic region sizing, this is the approximate number "   \
147           "of regions that would be used, within min/max region size "      \
148           "limits.")                                                        \
149                                                                             \
150   product(size_t, ShenandoahMinRegionSize, 256 * K, EXPERIMENTAL,           \
151           "With automatic region sizing, the regions would be at least "    \
152           "this large.")                                                    \
153                                                                             \
154   product(size_t, ShenandoahMaxRegionSize, 32 * M, EXPERIMENTAL,            \
155           "With automatic region sizing, the regions would be at most "     \
156           "this large.")                                                    \
157                                                                             \
158   product(ccstr, ShenandoahGCMode, "satb",                                  \
159           "GC mode to use.  Among other things, this defines which "        \
160           "barriers are in in use. Possible values are:"                    \
161           " satb - snapshot-at-the-beginning concurrent GC (three pass mark-evac-update);"  \
162           " passive - stop the world GC only (either degenerated or full);" \
163           " generational - generational concurrent GC")                     \
164                                                                             \
165   product(ccstr, ShenandoahGCHeuristics, "adaptive",                        \
166           "GC heuristics to use. This fine-tunes the GC mode selected, "    \
167           "by choosing when to start the GC, how much to process on each "  \
168           "cycle, and what other features to automatically enable. "        \
169           "When -XX:ShenandoahGCMode is generational, the only supported "  \
170           "option is the default, adaptive. Possible values are:"           \
171           " adaptive - adapt to maintain the given amount of free heap "    \
172           "at all times, even during the GC cycle;"                         \
173           " static - trigger GC when free heap falls below a specified "    \
174           "threshold;"                                                      \
175           " aggressive - run GC continuously, try to evacuate everything;"  \
176           " compact - run GC more frequently and with deeper targets to "   \
177           "free up more memory.")                                           \
178                                                                             \
179   product(uintx, ShenandoahExpeditePromotionsThreshold, 5, EXPERIMENTAL,    \
180           "When Shenandoah expects to promote at least this percentage "    \
181           "of the young generation, trigger a young collection to "         \
182           "expedite these promotions.")                                     \
183           range(0,100)                                                      \
184                                                                             \
185   product(uintx, ShenandoahExpediteMixedThreshold, 10, EXPERIMENTAL,        \
186           "When there are this many old regions waiting to be collected, "  \
187           "trigger a mixed collection immediately.")                        \
188                                                                             \
189   product(uintx, ShenandoahGarbageThreshold, 25, EXPERIMENTAL,              \
190           "How much garbage a region has to contain before it would be "    \
191           "taken for collection. This a guideline only, as GC heuristics "  \
192           "may select the region for collection even if it has little "     \
193           "garbage. This also affects how much internal fragmentation the " \
194           "collector accepts. In percents of heap region size.")            \
195           range(0,100)                                                      \
196                                                                             \
197   product(uintx, ShenandoahOldGarbageThreshold, 25, EXPERIMENTAL,           \
198           "How much garbage an old region has to contain before it would "  \
199           "be taken for collection.")                                       \
200           range(0,100)                                                      \
201                                                                             \
202   product(uintx, ShenandoahIgnoreGarbageThreshold, 5, EXPERIMENTAL,         \
203           "When less than this amount of garbage (as a percentage of "      \
204           "region size) exists within a region, the region will not be "    \
205           "added to the collection set, even when the heuristic has "       \
206           "chosen to aggressively add regions with less than "              \
207           "ShenandoahGarbageThreshold amount of garbage into the "          \
208           "collection set.")                                                \
209           range(0,100)                                                      \
210                                                                             \
211   product(uintx, ShenandoahInitFreeThreshold, 70, EXPERIMENTAL,             \
212           "When less than this amount of memory is free within the "        \
213           "heap or generation, trigger a learning cycle if we are "         \
214           "in learning mode.  Learning mode happens during initialization " \
215           "and following a drastic state change, such as following a "      \
216           "degenerated or Full GC cycle.  In percents of soft max "         \
217           "heap size.")                                                     \
218           range(0,100)                                                      \
219                                                                             \
220   product(uintx, ShenandoahMinFreeThreshold, 10, EXPERIMENTAL,              \
221           "Percentage of free heap memory (or young generation, in "        \
222           "generational mode) below which most heuristics trigger "         \
223           "collection independent of other triggers. Provides a safety "    \
224           "margin for many heuristics. In percents of (soft) max heap "     \
225           "size.")                                                          \
226           range(0,100)                                                      \
227                                                                             \
228   product(uintx, ShenandoahAllocationThreshold, 0, EXPERIMENTAL,            \
229           "How many new allocations should happen since the last GC cycle " \
230           "before some heuristics trigger the collection. In percents of "  \
231           "(soft) max heap size. Set to zero to effectively disable.")      \
232           range(0,100)                                                      \
233                                                                             \
234   product(uintx, ShenandoahAllocSpikeFactor, 5, EXPERIMENTAL,               \
235           "How much of heap should some heuristics reserve for absorbing "  \
236           "the allocation spikes. Larger value wastes more memory in "      \
237           "non-emergency cases, but provides more safety in emergency "     \
238           "cases. In percents of (soft) max heap size.")                    \
239           range(0,100)                                                      \
240                                                                             \
241   product(uintx, ShenandoahLearningSteps, 5, EXPERIMENTAL,                  \
242           "The number of cycles some heuristics take to collect in order "  \
243           "to learn application and GC performance.")                       \
244           range(0,100)                                                      \
245                                                                             \
246   product(uintx, ShenandoahImmediateThreshold, 70, EXPERIMENTAL,            \
247           "The cycle may shortcut when enough garbage can be reclaimed "    \
248           "from the immediate garbage (completely garbage regions). "       \
249           "In percents of total garbage found. Setting this threshold "     \
250           "to 100 effectively disables the shortcut.")                      \
251           range(0,100)                                                      \
252                                                                             \
253   product(uintx, ShenandoahAdaptiveSampleFrequencyHz, 10, EXPERIMENTAL,     \
254           "The number of times per second to update the allocation rate "   \
255           "moving average.")                                                \
256                                                                             \
257   product(uintx, ShenandoahAdaptiveSampleSizeSeconds, 10, EXPERIMENTAL,     \
258           "The size of the moving window over which the average "           \
259           "allocation rate is maintained. The total number of samples "     \
260           "is the product of this number and the sample frequency.")        \
261                                                                             \
262   product(double, ShenandoahAdaptiveInitialConfidence, 1.8, EXPERIMENTAL,   \
263           "The number of standard deviations used to determine an initial " \
264           "margin of error for the average cycle time and average "         \
265           "allocation rate. Increasing this value will cause the "          \
266           "heuristic to initiate more concurrent cycles." )                 \
267                                                                             \
268   product(double, ShenandoahAdaptiveInitialSpikeThreshold, 1.8, EXPERIMENTAL, \
269           "If the most recently sampled allocation rate is more than "      \
270           "this many standard deviations away from the moving average, "    \
271           "then a cycle is initiated. This value controls how sensitive "   \
272           "the heuristic is to allocation spikes. Decreasing this number "  \
273           "increases the sensitivity. ")                                    \
274                                                                             \
275   product(double, ShenandoahAdaptiveDecayFactor, 0.5, EXPERIMENTAL,         \
276           "The decay factor (alpha) used for values in the weighted "       \
277           "moving average of cycle time and allocation rate. "              \
278           "Larger values give more weight to recent values.")               \
279           range(0,1.0)                                                      \
280                                                                             \
281   product(uintx, ShenandoahGuaranteedGCInterval, 5*60*1000, EXPERIMENTAL,   \
282           "Many heuristics would guarantee a concurrent GC cycle at "       \
283           "least with this interval. This is useful when large idle "       \
284           "intervals are present, where GC can run without stealing "       \
285           "time from active application. Time is in milliseconds. "         \
286           "Setting this to 0 disables the feature.")                        \
287                                                                             \
288   product(uintx, ShenandoahGuaranteedOldGCInterval, 10*60*1000, EXPERIMENTAL, \
289           "Run a collection of the old generation at least this often. "    \
290           "Heuristics may trigger collections more frequently. Time is in " \
291           "milliseconds. Setting this to 0 disables the feature.")          \
292                                                                             \
293   product(uintx, ShenandoahGuaranteedYoungGCInterval, 5*60*1000,  EXPERIMENTAL,  \
294           "Run a collection of the young generation at least this often. "  \
295           "Heuristics may trigger collections more frequently. Time is in " \
296           "milliseconds. Setting this to 0 disables the feature.")          \
297                                                                             \
298   product(bool, ShenandoahAlwaysClearSoftRefs, false, EXPERIMENTAL,         \
299           "Unconditionally clear soft references, instead of using any "    \
300           "other cleanup policy. This minimizes footprint at expense of"    \
301           "more soft reference churn in applications.")                     \
302                                                                             \
303   product(bool, ShenandoahUncommit, true, EXPERIMENTAL,                     \
304           "Allow to uncommit memory under unused regions and metadata. "    \
305           "This optimizes footprint at expense of allocation latency in "   \
306           "regions that require committing back. Uncommits would be "       \
307           "disabled by some heuristics, or with static heap size.")         \
308                                                                             \
309   product(uintx, ShenandoahUncommitDelay, 5*60*1000, EXPERIMENTAL,          \
310           "Uncommit memory for regions that were not used for more than "   \
311           "this time. First use after that would incur allocation stalls. " \
312           "Actively used regions would never be uncommitted, because they " \
313           "do not become unused longer than this delay. Time is in "        \
314           "milliseconds. Setting this delay to 0 effectively uncommits "    \
315           "regions almost immediately after they become unused.")           \
316                                                                             \
317   product(bool, ShenandoahRegionSampling, false, EXPERIMENTAL,              \
318           "Provide heap region sampling data via jvmstat.")                 \
319                                                                             \
320   product(int, ShenandoahRegionSamplingRate, 40, EXPERIMENTAL,              \
321           "Sampling rate for heap region sampling. In milliseconds between "\
322           "the samples. Higher values provide more fidelity, at expense "   \
323           "of more sampling overhead.")                                     \
324                                                                             \
325   product(uintx, ShenandoahControlIntervalMin, 1, EXPERIMENTAL,             \
326           "The minimum sleep interval for the control loop that drives "    \
327           "the cycles. Lower values would increase GC responsiveness "      \
328           "to changing heap conditions, at the expense of higher perf "     \
329           "overhead. Time is in milliseconds.")                             \
330           range(1, 999)                                                     \
331                                                                             \
332   product(uintx, ShenandoahControlIntervalMax, 10, EXPERIMENTAL,            \
333           "The maximum sleep interval for control loop that drives "        \
334           "the cycles. Lower values would increase GC responsiveness "      \
335           "to changing heap conditions, at the expense of higher perf "     \
336           "overhead. Time is in milliseconds.")                             \
337           range(1, 999)                                                     \
338                                                                             \
339   product(uintx, ShenandoahControlIntervalAdjustPeriod, 1000, EXPERIMENTAL, \
340           "The time period for one step in control loop interval "          \
341           "adjustment. Lower values make adjustments faster, at the "       \
342           "expense of higher perf overhead. Time is in milliseconds.")      \
343                                                                             \
344   product(bool, ShenandoahVerify, false, DIAGNOSTIC,                        \
345           "Enable internal verification. This would catch many GC bugs, "   \
346           "but it would also stall the collector during the verification, " \
347           "which prolongs the pauses and might hide other bugs.")           \
348                                                                             \
349   product(intx, ShenandoahVerifyLevel, 4, DIAGNOSTIC,                       \
350           "Verification level, higher levels check more, taking more time. "\
351           "Accepted values are:"                                            \
352           " 0 = basic heap checks; "                                        \
353           " 1 = previous level, plus basic region checks; "                 \
354           " 2 = previous level, plus all roots; "                           \
355           " 3 = previous level, plus all reachable objects; "               \
356           " 4 = previous level, plus all marked objects")                   \
357                                                                             \
358   product(uintx, ShenandoahEvacReserve, 5, EXPERIMENTAL,                    \
359           "How much of (young-generation) heap to reserve for "             \
360           "(young-generation) evacuations.  Larger values allow GC to "     \
361           "evacuate more live objects on every cycle, while leaving "       \
362           "less headroom for application to allocate while GC is "          \
363           "evacuating and updating references. This parameter is "          \
364           "consulted at the end of marking, before selecting the "          \
365           "collection set.  If available memory at this time is smaller "   \
366           "than the indicated reserve, the bound on collection set size is "\
367           "adjusted downward.  The size of a generational mixed "           \
368           "evacuation collection set (comprised of both young and old "     \
369           "regions) is also bounded by this parameter.  In percents of "    \
370           "total (young-generation) heap size.")                            \
371           range(1,100)                                                      \
372                                                                             \
373   product(double, ShenandoahEvacWaste, 1.2, EXPERIMENTAL,                   \
374           "How much waste evacuations produce within the reserved space. "  \
375           "Larger values make evacuations more resilient against "          \
376           "evacuation conflicts, at expense of evacuating less on each "    \
377           "GC cycle.  Smaller values increase the risk of evacuation "      \
378           "failures, which will trigger stop-the-world Full GC passes.")    \
379           range(1.0,100.0)                                                  \
380                                                                             \
381   product(double, ShenandoahOldEvacWaste, 1.4, EXPERIMENTAL,                \
382           "How much waste evacuations produce within the reserved space. "  \
383           "Larger values make evacuations more resilient against "          \
384           "evacuation conflicts, at expense of evacuating less on each "    \
385           "GC cycle.  Smaller values increase the risk of evacuation "      \
386           "failures, which will trigger stop-the-world Full GC passes.")    \
387           range(1.0,100.0)                                                  \
388                                                                             \
389   product(double, ShenandoahPromoEvacWaste, 1.2, EXPERIMENTAL,              \
390           "How much waste promotions produce within the reserved space. "   \
391           "Larger values make evacuations more resilient against "          \
392           "evacuation conflicts, at expense of promoting less on each "     \
393           "GC cycle.  Smaller values increase the risk of evacuation "      \
394           "failures, which will trigger stop-the-world Full GC passes.")    \
395           range(1.0,100.0)                                                  \
396                                                                             \
397   product(bool, ShenandoahEvacReserveOverflow, true, EXPERIMENTAL,          \
398           "Allow evacuations to overflow the reserved space. Enabling it "  \
399           "will make evacuations more resilient when evacuation "           \
400           "reserve/waste is incorrect, at the risk that application "       \
401           "runs out of memory too early.")                                  \
402                                                                             \
403   product(uintx, ShenandoahOldEvacPercent, 75, EXPERIMENTAL,                \
404           "The maximum evacuation to old-gen expressed as a percent of "    \
405           "the total live memory within the collection set.  With the "     \
406           "default setting, if collection set evacuates X, no more than "   \
407           "75% of X may hold objects evacuated from old or promoted to "    \
408           "old from young.  A value of 100 allows the entire collection "   \
409           "set to be comprised of old-gen regions and young regions that "  \
410           "have reached the tenure age.  Larger values allow fewer mixed "  \
411           "evacuations to reclaim all the garbage from old.  Smaller "      \
412           "values result in less variation in GC cycle times between "      \
413           "young vs. mixed cycles.  A value of 0 prevents mixed "           \
414           "evacations from running and blocks promotion of aged regions "   \
415           "by evacuation.  Setting the value to 0 does not prevent "        \
416           "regions from being promoted in place.")                          \
417           range(0,100)                                                      \
418                                                                             \
419   product(bool, ShenandoahEvacTracking, false, DIAGNOSTIC,                  \
420           "Collect additional metrics about evacuations. Enabling this "    \
421           "tracks how many objects and how many bytes were evacuated, and " \
422           "how many were abandoned. The information will be categorized "   \
423           "by thread type (worker or mutator) and evacuation type (young, " \
424           "old, or promotion.")                                             \
425                                                                             \
426   product(uintx, ShenandoahCriticalFreeThreshold, 1, EXPERIMENTAL,          \
427           "How much of the heap needs to be free after recovery cycles, "   \
428           "either Degenerated or Full GC to be claimed successful. If this "\
429           "much space is not available, next recovery step would be "       \
430           "triggered.")                                                     \
431           range(0, 100)                                                     \
432                                                                             \
433   product(bool, ShenandoahDegeneratedGC, true, DIAGNOSTIC,                  \
434           "Enable Degenerated GC as the graceful degradation step. "        \
435           "Disabling this option leads to degradation to Full GC instead. " \
436           "When running in passive mode, this can be toggled to measure "   \
437           "either Degenerated GC or Full GC costs.")                        \
438                                                                             \
439   product(uintx, ShenandoahFullGCThreshold, 3, EXPERIMENTAL,                \
440           "How many back-to-back Degenerated GCs should happen before "     \
441           "going to a Full GC.")                                            \
442                                                                             \
443   product(uintx, ShenandoahNoProgressThreshold, 5, EXPERIMENTAL,            \
444           "After this number of consecutive Full GCs fail to make "         \
445           "progress, Shenandoah will raise out of memory errors. Note "     \
446           "that progress is determined by ShenandoahCriticalFreeThreshold") \
447                                                                             \
448   product(bool, ShenandoahImplicitGCInvokesConcurrent, false, EXPERIMENTAL, \
449           "Should internally-caused GC requests invoke concurrent cycles, " \
450           "should they do the stop-the-world (Degenerated / Full GC)? "     \
451           "Many heuristics automatically enable this. This option is "      \
452           "similar to global ExplicitGCInvokesConcurrent.")                 \
453                                                                             \
454   product(bool, ShenandoahHumongousMoves, true, DIAGNOSTIC,                 \
455           "Allow moving humongous regions. This makes GC more resistant "   \
456           "to external fragmentation that may otherwise fail other "        \
457           "humongous allocations, at the expense of higher GC copying "     \
458           "costs. Currently affects stop-the-world (Full) cycle only.")     \
459                                                                             \
460   product(bool, ShenandoahOOMDuringEvacALot, false, DIAGNOSTIC,             \
461           "Testing: simulate OOM during evacuation.")                       \
462                                                                             \
463   product(bool, ShenandoahAllocFailureALot, false, DIAGNOSTIC,              \
464           "Testing: make lots of artificial allocation failures.")          \
465                                                                             \
466   product(uintx, ShenandoahCoalesceChance, 0, DIAGNOSTIC,                   \
467           "Testing: Abandon remaining mixed collections with this "         \
468           "likelihood. Following each mixed collection, abandon all "       \
469           "remaining mixed collection candidate regions with likelihood "   \
470           "ShenandoahCoalesceChance. Abandoning a mixed collection will "   \
471           "cause the old regions to be made parsable, rather than being "   \
472           "evacuated.")                                                     \
473           range(0, 100)                                                     \
474                                                                             \
475   product(intx, ShenandoahMarkScanPrefetch, 32, EXPERIMENTAL,               \
476           "How many objects to prefetch ahead when traversing mark bitmaps."\
477           "Set to 0 to disable prefetching.")                               \
478           range(0, 256)                                                     \
479                                                                             \
480   product(uintx, ShenandoahMarkLoopStride, 1000, EXPERIMENTAL,              \
481           "How many items to process during one marking iteration before "  \
482           "checking for cancellation, yielding, etc. Larger values improve "\
483           "marking performance at expense of responsiveness.")              \
484                                                                             \
485   product(uintx, ShenandoahParallelRegionStride, 0, EXPERIMENTAL,           \
486           "How many regions to process at once during parallel region "     \
487           "iteration. Affects heaps with lots of regions. "                 \
488           "Set to 0 to let Shenandoah to decide the best value.")           \
489                                                                             \
490   product(size_t, ShenandoahSATBBufferSize, 1 * K, EXPERIMENTAL,            \
491           "Number of entries in an SATB log buffer.")                       \
492           range(1, max_uintx)                                               \
493                                                                             \
494   product(uintx, ShenandoahMaxSATBBufferFlushes, 5, EXPERIMENTAL,           \
495           "How many times to maximum attempt to flush SATB buffers at the " \
496           "end of concurrent marking.")                                     \
497                                                                             \
498   product(bool, ShenandoahSATBBarrier, true, DIAGNOSTIC,                    \
499           "Turn on/off SATB barriers in Shenandoah")                        \
500                                                                             \
501   product(bool, ShenandoahCardBarrier, false, DIAGNOSTIC,                   \
502           "Turn on/off card-marking post-write barrier in Shenandoah: "     \
503           " true when ShenandoahGCMode is generational, false otherwise")   \
504                                                                             \
505   product(bool, ShenandoahCASBarrier, true, DIAGNOSTIC,                     \
506           "Turn on/off CAS barriers in Shenandoah")                         \
507                                                                             \
508   product(bool, ShenandoahCloneBarrier, true, DIAGNOSTIC,                   \
509           "Turn on/off clone barriers in Shenandoah")                       \
510                                                                             \
511   product(bool, ShenandoahLoadRefBarrier, true, DIAGNOSTIC,                 \
512           "Turn on/off load-reference barriers in Shenandoah")              \
513                                                                             \
514   product(bool, ShenandoahStackWatermarkBarrier, true, DIAGNOSTIC,          \
515           "Turn on/off stack watermark barriers in Shenandoah")             \
516                                                                             \
517   develop(bool, ShenandoahVerifyOptoBarriers, trueInDebug,                  \
518           "Verify no missing barriers in C2.")                              \
519                                                                             \
520   product(uintx, ShenandoahOldCompactionReserve, 8, EXPERIMENTAL,           \
521           "During generational GC, prevent promotions from filling "        \
522           "this number of heap regions.  These regions are reserved "       \
523           "for the purpose of supporting compaction of old-gen "            \
524           "memory.  Otherwise, old-gen memory cannot be compacted.")        \
525           range(0, 128)                                                     \
526                                                                             \
527   product(bool, ShenandoahAllowOldMarkingPreemption, true, DIAGNOSTIC,      \
528           "Allow young generation collections to suspend concurrent"        \
529           " marking in the old generation.")                                \
530                                                                             \
531   product(uintx, ShenandoahAgingCyclePeriod, 1, EXPERIMENTAL,               \
532           "With generational mode, increment the age of objects and"        \
533           "regions each time this many young-gen GC cycles are completed.") \
534                                                                             \
535   develop(bool, ShenandoahEnableCardStats, false,                           \
536           "Enable statistics collection related to clean & dirty cards")    \
537                                                                             \
538   develop(int, ShenandoahCardStatsLogInterval, 50,                          \
539           "Log cumulative card stats every so many remembered set or "      \
540           "update refs scans")                                              \
541                                                                             \
542   product(uintx, ShenandoahMinimumOldTimeMs, 100, EXPERIMENTAL,             \
543          "Minimum amount of time in milliseconds to run old collections "   \
544          "before a young collection is allowed to run. This is intended "   \
545          "to prevent starvation of the old collector. Setting this to "     \
546          "0 will allow back to back young collections to run during old "   \
547          "collections.")                                                    \
548   // end of GC_SHENANDOAH_FLAGS
549 
550 #endif // SHARE_GC_SHENANDOAH_SHENANDOAH_GLOBALS_HPP