< prev index next >

src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp

Print this page

  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                                                                             \
 67   product(ccstr, ShenandoahGCHeuristics, "adaptive",                        \
 68           "GC heuristics to use. This fine-tunes the GC mode selected, "    \
 69           "by choosing when to start the GC, how much to process on each "  \
 70           "cycle, and what other features to automatically enable. "        \
 71           "Possible values are:"                                            \
 72           " adaptive - adapt to maintain the given amount of free heap "    \
 73           "at all times, even during the GC cycle;"                         \
 74           " static -  trigger GC when free heap falls below the threshold;" \
 75           " aggressive - run GC continuously, try to evacuate everything;"  \
 76           " compact - run GC more frequently and with deeper targets to "   \
 77           "free up more memory.")                                           \
 78                                                                             \










 79   product(uintx, ShenandoahGarbageThreshold, 25, EXPERIMENTAL,              \
 80           "How much garbage a region has to contain before it would be "    \
 81           "taken for collection. This a guideline only, as GC heuristics "  \
 82           "may select the region for collection even if it has little "     \
 83           "garbage. This also affects how much internal fragmentation the " \
 84           "collector accepts. In percents of heap region size.")            \
 85           range(0,100)                                                      \
 86                                                                             \














 87   product(uintx, ShenandoahInitFreeThreshold, 70, EXPERIMENTAL,             \
 88           "How much heap should be free before some heuristics trigger the "\
 89           "initial (learning) cycles. Affects cycle frequency on startup "  \
 90           "and after drastic state changes, e.g. after degenerated/full "   \
 91           "GC cycles. In percents of (soft) max heap size.")                \


 92           range(0,100)                                                      \
 93                                                                             \
 94   product(uintx, ShenandoahMinFreeThreshold, 10, EXPERIMENTAL,              \
 95           "How much heap should be free before most heuristics trigger the "\
 96           "collection, even without other triggers. Provides the safety "   \
 97           "margin for many heuristics. In percents of (soft) max heap size.")\


 98           range(0,100)                                                      \
 99                                                                             \
100   product(uintx, ShenandoahAllocationThreshold, 0, EXPERIMENTAL,            \
101           "How many new allocations should happen since the last GC cycle " \
102           "before some heuristics trigger the collection. In percents of "  \
103           "(soft) max heap size. Set to zero to effectively disable.")      \
104           range(0,100)                                                      \
105                                                                             \
106   product(uintx, ShenandoahAllocSpikeFactor, 5, EXPERIMENTAL,               \
107           "How much of heap should some heuristics reserve for absorbing "  \
108           "the allocation spikes. Larger value wastes more memory in "      \
109           "non-emergency cases, but provides more safety in emergency "     \
110           "cases. In percents of (soft) max heap size.")                    \
111           range(0,100)                                                      \
112                                                                             \
113   product(uintx, ShenandoahLearningSteps, 5, EXPERIMENTAL,                  \
114           "The number of cycles some heuristics take to collect in order "  \
115           "to learn application and GC performance.")                       \
116           range(0,100)                                                      \
117                                                                             \
118   product(uintx, ShenandoahImmediateThreshold, 90, EXPERIMENTAL,            \
119           "The cycle may shortcut when enough garbage can be reclaimed "    \
120           "from the immediate garbage (completely garbage regions). "       \
121           "In percents of total garbage found. Setting this threshold "     \
122           "to 100 effectively disables the shortcut.")                      \
123           range(0,100)                                                      \
124                                                                             \
125   product(uintx, ShenandoahAdaptiveSampleFrequencyHz, 10, EXPERIMENTAL,     \
126           "The number of times per second to update the allocation rate "   \
127           "moving average.")                                                \
128                                                                             \
129   product(uintx, ShenandoahAdaptiveSampleSizeSeconds, 10, EXPERIMENTAL,     \
130           "The size of the moving window over which the average "           \
131           "allocation rate is maintained. The total number of samples "     \
132           "is the product of this number and the sample frequency.")        \
133                                                                             \
134   product(double, ShenandoahAdaptiveInitialConfidence, 1.8, EXPERIMENTAL,   \
135           "The number of standard deviations used to determine an initial " \
136           "margin of error for the average cycle time and average "         \
137           "allocation rate. Increasing this value will cause the "          \
138           "heuristic to initiate more concurrent cycles." )                 \

140   product(double, ShenandoahAdaptiveInitialSpikeThreshold, 1.8, EXPERIMENTAL, \
141           "If the most recently sampled allocation rate is more than "      \
142           "this many standard deviations away from the moving average, "    \
143           "then a cycle is initiated. This value controls how sensitive "   \
144           "the heuristic is to allocation spikes. Decreasing this number "  \
145           "increases the sensitivity. ")                                    \
146                                                                             \
147   product(double, ShenandoahAdaptiveDecayFactor, 0.5, EXPERIMENTAL,         \
148           "The decay factor (alpha) used for values in the weighted "       \
149           "moving average of cycle time and allocation rate. "              \
150           "Larger values give more weight to recent values.")               \
151           range(0,1.0)                                                      \
152                                                                             \
153   product(uintx, ShenandoahGuaranteedGCInterval, 5*60*1000, EXPERIMENTAL,   \
154           "Many heuristics would guarantee a concurrent GC cycle at "       \
155           "least with this interval. This is useful when large idle "       \
156           "intervals are present, where GC can run without stealing "       \
157           "time from active application. Time is in milliseconds. "         \
158           "Setting this to 0 disables the feature.")                        \
159                                                                             \










160   product(bool, ShenandoahAlwaysClearSoftRefs, false, EXPERIMENTAL,         \
161           "Unconditionally clear soft references, instead of using any "    \
162           "other cleanup policy. This minimizes footprint at expense of"    \
163           "more soft reference churn in applications.")                     \
164                                                                             \
165   product(bool, ShenandoahUncommit, true, EXPERIMENTAL,                     \
166           "Allow to uncommit memory under unused regions and metadata. "    \
167           "This optimizes footprint at expense of allocation latency in "   \
168           "regions that require committing back. Uncommits would be "       \
169           "disabled by some heuristics, or with static heap size.")         \
170                                                                             \
171   product(uintx, ShenandoahUncommitDelay, 5*60*1000, EXPERIMENTAL,          \
172           "Uncommit memory for regions that were not used for more than "   \
173           "this time. First use after that would incur allocation stalls. " \
174           "Actively used regions would never be uncommitted, because they " \
175           "do not become unused longer than this delay. Time is in "        \
176           "milliseconds. Setting this delay to 0 effectively uncommits "    \
177           "regions almost immediately after they become unused.")           \
178                                                                             \
179   product(bool, ShenandoahRegionSampling, false, EXPERIMENTAL,              \

199   product(uintx, ShenandoahControlIntervalAdjustPeriod, 1000, EXPERIMENTAL, \
200           "The time period for one step in control loop interval "          \
201           "adjustment. Lower values make adjustments faster, at the "       \
202           "expense of higher perf overhead. Time is in milliseconds.")      \
203                                                                             \
204   product(bool, ShenandoahVerify, false, DIAGNOSTIC,                        \
205           "Enable internal verification. This would catch many GC bugs, "   \
206           "but it would also stall the collector during the verification, " \
207           "which prolongs the pauses and might hide other bugs.")           \
208                                                                             \
209   product(intx, ShenandoahVerifyLevel, 4, DIAGNOSTIC,                       \
210           "Verification level, higher levels check more, taking more time. "\
211           "Accepted values are:"                                            \
212           " 0 = basic heap checks; "                                        \
213           " 1 = previous level, plus basic region checks; "                 \
214           " 2 = previous level, plus all roots; "                           \
215           " 3 = previous level, plus all reachable objects; "               \
216           " 4 = previous level, plus all marked objects")                   \
217                                                                             \
218   product(uintx, ShenandoahEvacReserve, 5, EXPERIMENTAL,                    \
219           "How much of heap to reserve for evacuations. Larger values make "\
220           "GC evacuate more live objects on every cycle, while leaving "    \
221           "less headroom for application to allocate in. In percents of "   \
222           "total heap size.")                                               \








223           range(1,100)                                                      \
224                                                                             \
225   product(double, ShenandoahEvacWaste, 1.2, EXPERIMENTAL,                   \
226           "How much waste evacuations produce within the reserved space. "  \
227           "Larger values make evacuations more resilient against "          \
228           "evacuation conflicts, at expense of evacuating less on each "    \
229           "GC cycle.")                                                      \

















230           range(1.0,100.0)                                                  \
231                                                                             \
232   product(bool, ShenandoahEvacReserveOverflow, true, EXPERIMENTAL,          \
233           "Allow evacuations to overflow the reserved space. Enabling it "  \
234           "will make evacuations more resilient when evacuation "           \
235           "reserve/waste is incorrect, at the risk that application "       \
236           "runs out of memory too early.")                                  \
237                                                                             \



































238   product(bool, ShenandoahPacing, true, EXPERIMENTAL,                       \
239           "Pace application allocations to give GC chance to start "        \
240           "and complete before allocation failure is reached.")             \
241                                                                             \
242   product(uintx, ShenandoahPacingMaxDelay, 10, EXPERIMENTAL,                \
243           "Max delay for pacing application allocations. Larger values "    \
244           "provide more resilience against out of memory, at expense at "   \
245           "hiding the GC latencies in the allocation path. Time is in "     \
246           "milliseconds. Setting it to arbitrarily large value makes "      \
247           "GC effectively stall the threads indefinitely instead of going " \
248           "to degenerated or Full GC.")                                     \
249                                                                             \
250   product(uintx, ShenandoahPacingIdleSlack, 2, EXPERIMENTAL,                \
251           "How much of heap counted as non-taxable allocations during idle "\
252           "phases. Larger value makes the pacing milder when collector is " \
253           "idle, requiring less rendezvous with control thread. Lower "     \
254           "value makes the pacing control less responsive to out-of-cycle " \
255           "allocs. In percent of total heap size.")                         \
256           range(0, 100)                                                     \
257                                                                             \

269           "the beginning of it.")                                           \
270           range(1.0, 100.0)                                                 \
271                                                                             \
272   product(uintx, ShenandoahCriticalFreeThreshold, 1, EXPERIMENTAL,          \
273           "How much of the heap needs to be free after recovery cycles, "   \
274           "either Degenerated or Full GC to be claimed successful. If this "\
275           "much space is not available, next recovery step would be "       \
276           "triggered.")                                                     \
277           range(0, 100)                                                     \
278                                                                             \
279   product(bool, ShenandoahDegeneratedGC, true, DIAGNOSTIC,                  \
280           "Enable Degenerated GC as the graceful degradation step. "        \
281           "Disabling this option leads to degradation to Full GC instead. " \
282           "When running in passive mode, this can be toggled to measure "   \
283           "either Degenerated GC or Full GC costs.")                        \
284                                                                             \
285   product(uintx, ShenandoahFullGCThreshold, 3, EXPERIMENTAL,                \
286           "How many back-to-back Degenerated GCs should happen before "     \
287           "going to a Full GC.")                                            \
288                                                                             \





289   product(bool, ShenandoahImplicitGCInvokesConcurrent, false, EXPERIMENTAL, \
290           "Should internally-caused GC requests invoke concurrent cycles, " \
291           "should they do the stop-the-world (Degenerated / Full GC)? "     \
292           "Many heuristics automatically enable this. This option is "      \
293           "similar to global ExplicitGCInvokesConcurrent.")                 \
294                                                                             \
295   product(bool, ShenandoahHumongousMoves, true, DIAGNOSTIC,                 \
296           "Allow moving humongous regions. This makes GC more resistant "   \
297           "to external fragmentation that may otherwise fail other "        \
298           "humongous allocations, at the expense of higher GC copying "     \
299           "costs. Currently affects stop-the-world (Full) cycle only.")     \
300                                                                             \
301   product(bool, ShenandoahOOMDuringEvacALot, false, DIAGNOSTIC,             \
302           "Testing: simulate OOM during evacuation.")                       \
303                                                                             \
304   product(bool, ShenandoahAllocFailureALot, false, DIAGNOSTIC,              \
305           "Testing: make lots of artificial allocation failures.")          \
306                                                                             \









307   product(intx, ShenandoahMarkScanPrefetch, 32, EXPERIMENTAL,               \
308           "How many objects to prefetch ahead when traversing mark bitmaps."\
309           "Set to 0 to disable prefetching.")                               \
310           range(0, 256)                                                     \
311                                                                             \
312   product(uintx, ShenandoahMarkLoopStride, 1000, EXPERIMENTAL,              \
313           "How many items to process during one marking iteration before "  \
314           "checking for cancellation, yielding, etc. Larger values improve "\
315           "marking performance at expense of responsiveness.")              \
316                                                                             \
317   product(uintx, ShenandoahParallelRegionStride, 1024, EXPERIMENTAL,        \
318           "How many regions to process at once during parallel region "     \
319           "iteration. Affects heaps with lots of regions.")                 \
320                                                                             \
321   product(size_t, ShenandoahSATBBufferSize, 1 * K, EXPERIMENTAL,            \
322           "Number of entries in an SATB log buffer.")                       \
323           range(1, max_uintx)                                               \
324                                                                             \
325   product(uintx, ShenandoahMaxSATBBufferFlushes, 5, EXPERIMENTAL,           \
326           "How many times to maximum attempt to flush SATB buffers at the " \
327           "end of concurrent marking.")                                     \
328                                                                             \
329   product(bool, ShenandoahSATBBarrier, true, DIAGNOSTIC,                    \
330           "Turn on/off SATB barriers in Shenandoah")                        \
331                                                                             \
332   product(bool, ShenandoahIUBarrier, false, DIAGNOSTIC,                     \
333           "Turn on/off I-U barriers barriers in Shenandoah")                \
334                                                                             \




335   product(bool, ShenandoahCASBarrier, true, DIAGNOSTIC,                     \
336           "Turn on/off CAS barriers in Shenandoah")                         \
337                                                                             \
338   product(bool, ShenandoahCloneBarrier, true, DIAGNOSTIC,                   \
339           "Turn on/off clone barriers in Shenandoah")                       \
340                                                                             \
341   product(bool, ShenandoahLoadRefBarrier, true, DIAGNOSTIC,                 \
342           "Turn on/off load-reference barriers in Shenandoah")              \
343                                                                             \
344   product(bool, ShenandoahStackWatermarkBarrier, true, DIAGNOSTIC,          \
345           "Turn on/off stack watermark barriers in Shenandoah")             \
346                                                                             \
347   develop(bool, ShenandoahVerifyOptoBarriers, trueInDebug,                  \
348           "Verify no missing barriers in C2.")                              \
349                                                                             \
350 
351 // end of GC_SHENANDOAH_FLAGS



























352 
353 #endif // SHARE_GC_SHENANDOAH_SHENANDOAH_GLOBALS_HPP

  1 /*
  2  * Copyright (c) 2020, 2023, 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                             notproduct,                                     \
 35                             range,                                          \
 36                             constraint)                                     \
 37                                                                             \
 38   product(uintx, ShenandoahGenerationalHumongousReserve, 0, EXPERIMENTAL,   \
 39           "(Generational mode only) What percent of the heap should be "    \
 40           "reserved for humongous objects if possible.  Old-generation "    \
 41           "collections will endeavor to evacuate old-gen regions within "   \
 42           "this reserved area even if these regions do not contain high "   \
 43           "percentage of garbage.  Setting a larger value will cause "      \
 44           "more frequent old-gen collections.  A smaller value will "       \
 45           "increase the likelihood that humongous object allocations "      \
 46           "fail, resulting in stop-the-world full GCs.")                    \
 47           range(0,100)                                                      \
 48                                                                             \
 49   product(double, ShenandoahMinOldGenGrowthPercent, 12.5, EXPERIMENTAL,     \
 50           "(Generational mode only) If the usage within old generation "    \
 51           "has grown by at least this percent of its live memory size "     \
 52           "at completion of the most recent old-generation marking "        \
 53           "effort, heuristics may trigger the start of a new old-gen "      \
 54           "collection.")                                                    \
 55           range(0.0,100.0)                                                  \
 56                                                                             \
 57   product(uintx, ShenandoahIgnoreOldGrowthBelowPercentage,10, EXPERIMENTAL, \
 58           "(Generational mode only) If the total usage of the old "         \
 59           "generation is smaller than this percent, we do not trigger "     \
 60           "old gen collections even if old has grown, except when "         \
 61           "ShenandoahGenerationalDoNotIgnoreGrowthAfterYoungCycles "        \
 62           "consecutive cycles have been completed following the "           \
 63           "preceding old-gen collection.")                                  \
 64           range(0,100)                                                      \
 65                                                                             \
 66   product(uintx, ShenandoahDoNotIgnoreGrowthAfterYoungCycles,               \
 67           50, EXPERIMENTAL,                                                 \
 68           "(Generational mode only) Even if the usage of old generation "   \
 69           "is below ShenandoahIgnoreOldGrowthBelowPercentage, "             \
 70           "trigger an old-generation mark if old has grown and this "       \
 71           "many consecutive young-gen collections have been "               \
 72           "completed following the preceding old-gen collection.")          \
 73                                                                             \
 74   product(bool, ShenandoahGenerationalCensusAtEvac, false, EXPERIMENTAL,    \
 75           "(Generational mode only) Object age census at evacuation, "      \
 76           "rather than during marking.")                                    \
 77                                                                             \
 78   product(bool, ShenandoahGenerationalAdaptiveTenuring, true, EXPERIMENTAL, \
 79           "(Generational mode only) Dynamically adapt tenuring age.")       \
 80                                                                             \
 81   product(bool, ShenandoahGenerationalCensusIgnoreOlderCohorts, true,       \
 82                                                                EXPERIMENTAL,\
 83           "(Generational mode only) Ignore mortality rates older than the " \
 84           "oldest cohort under the tenuring age for the last cycle." )      \
 85                                                                             \
 86   product(uintx, ShenandoahGenerationalMinTenuringAge, 1, EXPERIMENTAL,     \
 87           "(Generational mode only) Floor for adaptive tenuring age. "      \
 88           "Setting floor and ceiling to the same value fixes the tenuring " \
 89           "age; setting both to 1 simulates a poor approximation to "       \
 90           "AlwaysTenure, and setting both to 16 simulates NeverTenure.")    \
 91           range(1,16)                                                       \
 92                                                                             \
 93   product(uintx, ShenandoahGenerationalMaxTenuringAge, 15, EXPERIMENTAL,    \
 94           "(Generational mode only) Ceiling for adaptive tenuring age. "    \
 95           "Setting floor and ceiling to the same value fixes the tenuring " \
 96           "age; setting both to 1 simulates a poor approximation to "       \
 97           "AlwaysTenure, and setting both to 16 simulates NeverTenure.")    \
 98           range(1,16)                                                       \
 99                                                                             \
100   product(double, ShenandoahGenerationalTenuringMortalityRateThreshold,     \
101                                                          0.1, EXPERIMENTAL, \
102           "(Generational mode only) Cohort mortality rates below this "     \
103           "value will be treated as indicative of longevity, leading to "   \
104           "tenuring. A lower value delays tenuring, a higher value hastens "\
105           "it. Used only when ShenandoahGenerationalhenAdaptiveTenuring is "\
106           "enabled.")                                                       \
107           range(0.001,0.999)                                                \
108                                                                             \
109   product(size_t, ShenandoahGenerationalTenuringCohortPopulationThreshold,  \
110                                                          4*K, EXPERIMENTAL, \
111           "(Generational mode only) Cohorts whose population is lower than "\
112           "this value in the previous census are ignored wrt tenuring "     \
113           "decisions. Effectively this makes then tenurable as soon as all "\
114           "older cohorts are. Set this value to the largest cohort "        \
115           "population volume that you are comfortable ignoring when making "\
116           "tenuring decisions.")                                            \
117                                                                             \
118   product(size_t, ShenandoahRegionSize, 0, EXPERIMENTAL,                    \
119           "Static heap region size. Set zero to enable automatic sizing.")  \
120                                                                             \
121   product(size_t, ShenandoahTargetNumRegions, 2048, EXPERIMENTAL,           \
122           "With automatic region sizing, this is the approximate number "   \
123           "of regions that would be used, within min/max region size "      \
124           "limits.")                                                        \
125                                                                             \
126   product(size_t, ShenandoahMinRegionSize, 256 * K, EXPERIMENTAL,           \
127           "With automatic region sizing, the regions would be at least "    \
128           "this large.")                                                    \
129                                                                             \
130   product(size_t, ShenandoahMaxRegionSize, 32 * M, EXPERIMENTAL,            \
131           "With automatic region sizing, the regions would be at most "     \
132           "this large.")                                                    \
133                                                                             \
134   product(intx, ShenandoahHumongousThreshold, 100, EXPERIMENTAL,            \
135           "Humongous objects are allocated in separate regions. "           \
136           "This setting defines how large the object should be to be "      \
137           "deemed humongous. Value is in  percents of heap region size. "   \
138           "This also caps the maximum TLAB size.")                          \
139           range(1, 100)                                                     \
140                                                                             \
141   product(ccstr, ShenandoahGCMode, "satb",                                  \
142           "GC mode to use.  Among other things, this defines which "        \
143           "barriers are in in use. Possible values are:"                    \
144           " satb - snapshot-at-the-beginning concurrent GC (three pass mark-evac-update);"  \
145           " iu - incremental-update concurrent GC (three pass mark-evac-update);"  \
146           " passive - stop the world GC only (either degenerated or full);" \
147           " generational - generational concurrent GC")                     \
148                                                                             \
149   product(ccstr, ShenandoahGCHeuristics, "adaptive",                        \
150           "GC heuristics to use. This fine-tunes the GC mode selected, "    \
151           "by choosing when to start the GC, how much to process on each "  \
152           "cycle, and what other features to automatically enable. "        \
153           "Possible values are:"                                            \
154           " adaptive - adapt to maintain the given amount of free heap "    \
155           "at all times, even during the GC cycle;"                         \
156           " static -  trigger GC when free heap falls below the threshold;" \
157           " aggressive - run GC continuously, try to evacuate everything;"  \
158           " compact - run GC more frequently and with deeper targets to "   \
159           "free up more memory.")                                           \
160                                                                             \
161   product(uintx, ShenandoahExpeditePromotionsThreshold, 5, EXPERIMENTAL,    \
162           "When Shenandoah expects to promote at least this percentage "    \
163           "of the young generation, trigger a young collection to "         \
164           "expedite these promotions.")                                     \
165           range(0,100)                                                      \
166                                                                             \
167   product(uintx, ShenandoahExpediteMixedThreshold, 10, EXPERIMENTAL,        \
168           "When there are this many old regions waiting to be collected, "  \
169           "trigger a mixed collection immediately.")                        \
170                                                                             \
171   product(uintx, ShenandoahGarbageThreshold, 25, EXPERIMENTAL,              \
172           "How much garbage a region has to contain before it would be "    \
173           "taken for collection. This a guideline only, as GC heuristics "  \
174           "may select the region for collection even if it has little "     \
175           "garbage. This also affects how much internal fragmentation the " \
176           "collector accepts. In percents of heap region size.")            \
177           range(0,100)                                                      \
178                                                                             \
179   product(uintx, ShenandoahOldGarbageThreshold, 15, EXPERIMENTAL,           \
180           "How much garbage an old region has to contain before it would "  \
181           "be taken for collection.")                                       \
182           range(0,100)                                                      \
183                                                                             \
184   product(uintx, ShenandoahIgnoreGarbageThreshold, 5, EXPERIMENTAL,         \
185           "When less than this amount of garbage (as a percentage of "      \
186           "region size) exists within a region, the region will not be "    \
187           "added to the collection set, even when the heuristic has "       \
188           "chosen to aggressively add regions with less than "              \
189           "ShenandoahGarbageThreshold amount of garbage into the "          \
190           "collection set.")                                                \
191           range(0,100)                                                      \
192                                                                             \
193   product(uintx, ShenandoahInitFreeThreshold, 70, EXPERIMENTAL,             \
194           "When less than this amount of memory is free within the"         \
195           "heap or generation, trigger a learning cycle if we are "         \
196           "in learning mode.  Learning mode happens during initialization " \
197           "and following a drastic state change, such as following a "      \
198           "degenerated or Full GC cycle.  In percents of soft max "         \
199           "heap size.")                                                     \
200           range(0,100)                                                      \
201                                                                             \
202   product(uintx, ShenandoahMinFreeThreshold, 10, EXPERIMENTAL,              \
203           "Percentage of free heap memory (or young generation, in "        \
204           "generational mode) below which most heuristics trigger "         \
205           "collection independent of other triggers. Provides a safety "    \
206           "margin for many heuristics. In percents of (soft) max heap "     \
207           "size.")                                                          \
208           range(0,100)                                                      \
209                                                                             \
210   product(uintx, ShenandoahAllocationThreshold, 0, EXPERIMENTAL,            \
211           "How many new allocations should happen since the last GC cycle " \
212           "before some heuristics trigger the collection. In percents of "  \
213           "(soft) max heap size. Set to zero to effectively disable.")      \
214           range(0,100)                                                      \
215                                                                             \
216   product(uintx, ShenandoahAllocSpikeFactor, 5, EXPERIMENTAL,               \
217           "How much of heap should some heuristics reserve for absorbing "  \
218           "the allocation spikes. Larger value wastes more memory in "      \
219           "non-emergency cases, but provides more safety in emergency "     \
220           "cases. In percents of (soft) max heap size.")                    \
221           range(0,100)                                                      \
222                                                                             \
223   product(uintx, ShenandoahLearningSteps, 5, EXPERIMENTAL,                  \
224           "The number of cycles some heuristics take to collect in order "  \
225           "to learn application and GC performance.")                       \
226           range(0,100)                                                      \
227                                                                             \
228   product(uintx, ShenandoahImmediateThreshold, 70, EXPERIMENTAL,            \
229           "The cycle may shortcut when enough garbage can be reclaimed "    \
230           "from the immediate garbage (completely garbage regions). "       \
231           "In percents of total garbage found. Setting this threshold "     \
232           "to 100 effectively disables the shortcut.")                      \
233           range(0,100)                                                      \
234                                                                             \
235   product(uintx, ShenandoahAdaptiveSampleFrequencyHz, 10, EXPERIMENTAL,     \
236           "The number of times per second to update the allocation rate "   \
237           "moving average.")                                                \
238                                                                             \
239   product(uintx, ShenandoahAdaptiveSampleSizeSeconds, 10, EXPERIMENTAL,     \
240           "The size of the moving window over which the average "           \
241           "allocation rate is maintained. The total number of samples "     \
242           "is the product of this number and the sample frequency.")        \
243                                                                             \
244   product(double, ShenandoahAdaptiveInitialConfidence, 1.8, EXPERIMENTAL,   \
245           "The number of standard deviations used to determine an initial " \
246           "margin of error for the average cycle time and average "         \
247           "allocation rate. Increasing this value will cause the "          \
248           "heuristic to initiate more concurrent cycles." )                 \

250   product(double, ShenandoahAdaptiveInitialSpikeThreshold, 1.8, EXPERIMENTAL, \
251           "If the most recently sampled allocation rate is more than "      \
252           "this many standard deviations away from the moving average, "    \
253           "then a cycle is initiated. This value controls how sensitive "   \
254           "the heuristic is to allocation spikes. Decreasing this number "  \
255           "increases the sensitivity. ")                                    \
256                                                                             \
257   product(double, ShenandoahAdaptiveDecayFactor, 0.5, EXPERIMENTAL,         \
258           "The decay factor (alpha) used for values in the weighted "       \
259           "moving average of cycle time and allocation rate. "              \
260           "Larger values give more weight to recent values.")               \
261           range(0,1.0)                                                      \
262                                                                             \
263   product(uintx, ShenandoahGuaranteedGCInterval, 5*60*1000, EXPERIMENTAL,   \
264           "Many heuristics would guarantee a concurrent GC cycle at "       \
265           "least with this interval. This is useful when large idle "       \
266           "intervals are present, where GC can run without stealing "       \
267           "time from active application. Time is in milliseconds. "         \
268           "Setting this to 0 disables the feature.")                        \
269                                                                             \
270   product(uintx, ShenandoahGuaranteedOldGCInterval, 10*60*1000, EXPERIMENTAL, \
271           "Run a collection of the old generation at least this often. "    \
272           "Heuristics may trigger collections more frequently. Time is in " \
273           "milliseconds. Setting this to 0 disables the feature.")          \
274                                                                             \
275   product(uintx, ShenandoahGuaranteedYoungGCInterval, 5*60*1000,  EXPERIMENTAL,  \
276           "Run a collection of the young generation at least this often. "  \
277           "Heuristics may trigger collections more frequently. Time is in " \
278           "milliseconds. Setting this to 0 disables the feature.")          \
279                                                                             \
280   product(bool, ShenandoahAlwaysClearSoftRefs, false, EXPERIMENTAL,         \
281           "Unconditionally clear soft references, instead of using any "    \
282           "other cleanup policy. This minimizes footprint at expense of"    \
283           "more soft reference churn in applications.")                     \
284                                                                             \
285   product(bool, ShenandoahUncommit, true, EXPERIMENTAL,                     \
286           "Allow to uncommit memory under unused regions and metadata. "    \
287           "This optimizes footprint at expense of allocation latency in "   \
288           "regions that require committing back. Uncommits would be "       \
289           "disabled by some heuristics, or with static heap size.")         \
290                                                                             \
291   product(uintx, ShenandoahUncommitDelay, 5*60*1000, EXPERIMENTAL,          \
292           "Uncommit memory for regions that were not used for more than "   \
293           "this time. First use after that would incur allocation stalls. " \
294           "Actively used regions would never be uncommitted, because they " \
295           "do not become unused longer than this delay. Time is in "        \
296           "milliseconds. Setting this delay to 0 effectively uncommits "    \
297           "regions almost immediately after they become unused.")           \
298                                                                             \
299   product(bool, ShenandoahRegionSampling, false, EXPERIMENTAL,              \

319   product(uintx, ShenandoahControlIntervalAdjustPeriod, 1000, EXPERIMENTAL, \
320           "The time period for one step in control loop interval "          \
321           "adjustment. Lower values make adjustments faster, at the "       \
322           "expense of higher perf overhead. Time is in milliseconds.")      \
323                                                                             \
324   product(bool, ShenandoahVerify, false, DIAGNOSTIC,                        \
325           "Enable internal verification. This would catch many GC bugs, "   \
326           "but it would also stall the collector during the verification, " \
327           "which prolongs the pauses and might hide other bugs.")           \
328                                                                             \
329   product(intx, ShenandoahVerifyLevel, 4, DIAGNOSTIC,                       \
330           "Verification level, higher levels check more, taking more time. "\
331           "Accepted values are:"                                            \
332           " 0 = basic heap checks; "                                        \
333           " 1 = previous level, plus basic region checks; "                 \
334           " 2 = previous level, plus all roots; "                           \
335           " 3 = previous level, plus all reachable objects; "               \
336           " 4 = previous level, plus all marked objects")                   \
337                                                                             \
338   product(uintx, ShenandoahEvacReserve, 5, EXPERIMENTAL,                    \
339           "How much of (young-generation) heap to reserve for "             \
340           "(young-generation) evacuations.  Larger values allow GC to "     \
341           "evacuate more live objects on every cycle, while leaving "       \
342           "less headroom for application to allocate while GC is "          \
343           "evacuating and updating references. This parameter is "          \
344           "consulted at the end of marking, before selecting the "          \
345           "collection set.  If available memory at this time is smaller "   \
346           "than the indicated reserve, the bound on collection set size is "\
347           "adjusted downward.  The size of a generational mixed "           \
348           "evacuation collection set (comprised of both young and old "     \
349           "regions) is also bounded by this parameter.  In percents of "    \
350           "total (young-generation) heap size.")                            \
351           range(1,100)                                                      \
352                                                                             \
353   product(double, ShenandoahEvacWaste, 1.2, EXPERIMENTAL,                   \
354           "How much waste evacuations produce within the reserved space. "  \
355           "Larger values make evacuations more resilient against "          \
356           "evacuation conflicts, at expense of evacuating less on each "    \
357           "GC cycle.  Smaller values increase the risk of evacuation "      \
358           "failures, which will trigger stop-the-world Full GC passes.")    \
359           range(1.0,100.0)                                                  \
360                                                                             \
361   product(double, ShenandoahOldEvacWaste, 1.4, EXPERIMENTAL,                \
362           "How much waste evacuations produce within the reserved space. "  \
363           "Larger values make evacuations more resilient against "          \
364           "evacuation conflicts, at expense of evacuating less on each "    \
365           "GC cycle.  Smaller values increase the risk of evacuation "      \
366           "failures, which will trigger stop-the-world Full GC passes.")    \
367           range(1.0,100.0)                                                  \
368                                                                             \
369   product(double, ShenandoahPromoEvacWaste, 1.2, EXPERIMENTAL,              \
370           "How much waste promotions produce within the reserved space. "   \
371           "Larger values make evacuations more resilient against "          \
372           "evacuation conflicts, at expense of promoting less on each "     \
373           "GC cycle.  Smaller values increase the risk of evacuation "      \
374           "failures, which will trigger stop-the-world Full GC passes.")    \
375           range(1.0,100.0)                                                  \
376                                                                             \
377   product(bool, ShenandoahEvacReserveOverflow, true, EXPERIMENTAL,          \
378           "Allow evacuations to overflow the reserved space. Enabling it "  \
379           "will make evacuations more resilient when evacuation "           \
380           "reserve/waste is incorrect, at the risk that application "       \
381           "runs out of memory too early.")                                  \
382                                                                             \
383   product(uintx, ShenandoahOldEvacRatioPercent, 75, EXPERIMENTAL,           \
384           "The maximum proportion of evacuation from old-gen memory, "      \
385           "expressed as a percentage. The default value 75 denotes that no" \
386           "more than 75% of the collection set evacuation workload may be " \
387           "towards evacuation of old-gen heap regions. This limits both the"\
388           "promotion of aged regions and the compaction of existing old "   \
389           "regions.  A value of 75 denotes that the total evacuation work"  \
390           "may increase to up to four times the young gen evacuation work." \
391           "A larger value allows quicker promotion and allows"              \
392           "a smaller number of mixed evacuations to process "               \
393           "the entire list of old-gen collection candidates at the cost "   \
394           "of an increased disruption of the normal cadence of young-gen "  \
395           "collections.  A value of 100 allows a mixed evacuation to "      \
396           "focus entirely on old-gen memory, allowing no young-gen "        \
397           "regions to be collected, likely resulting in subsequent "        \
398           "allocation failures because the allocation pool is not "         \
399           "replenished.  A value of 0 allows a mixed evacuation to"         \
400           "focus entirely on young-gen memory, allowing no old-gen "        \
401           "regions to be collected, likely resulting in subsequent "        \
402           "promotion failures and triggering of stop-the-world full GC "    \
403           "events.")                                                        \
404           range(0,100)                                                      \
405                                                                             \
406   product(uintx, ShenandoahMinYoungPercentage, 20, EXPERIMENTAL,            \
407           "The minimum percentage of the heap to use for the young "        \
408           "generation. Heuristics will not adjust the young generation "    \
409           "to be less than this.")                                          \
410           range(0, 100)                                                     \
411                                                                             \
412   product(uintx, ShenandoahMaxYoungPercentage, 100, EXPERIMENTAL,           \
413           "The maximum percentage of the heap to use for the young "        \
414           "generation. Heuristics will not adjust the young generation "    \
415           "to be more than this.")                                          \
416           range(0, 100)                                                     \
417                                                                             \
418   product(bool, ShenandoahPacing, true, EXPERIMENTAL,                       \
419           "Pace application allocations to give GC chance to start "        \
420           "and complete before allocation failure is reached.")             \
421                                                                             \
422   product(uintx, ShenandoahPacingMaxDelay, 10, EXPERIMENTAL,                \
423           "Max delay for pacing application allocations. Larger values "    \
424           "provide more resilience against out of memory, at expense at "   \
425           "hiding the GC latencies in the allocation path. Time is in "     \
426           "milliseconds. Setting it to arbitrarily large value makes "      \
427           "GC effectively stall the threads indefinitely instead of going " \
428           "to degenerated or Full GC.")                                     \
429                                                                             \
430   product(uintx, ShenandoahPacingIdleSlack, 2, EXPERIMENTAL,                \
431           "How much of heap counted as non-taxable allocations during idle "\
432           "phases. Larger value makes the pacing milder when collector is " \
433           "idle, requiring less rendezvous with control thread. Lower "     \
434           "value makes the pacing control less responsive to out-of-cycle " \
435           "allocs. In percent of total heap size.")                         \
436           range(0, 100)                                                     \
437                                                                             \

449           "the beginning of it.")                                           \
450           range(1.0, 100.0)                                                 \
451                                                                             \
452   product(uintx, ShenandoahCriticalFreeThreshold, 1, EXPERIMENTAL,          \
453           "How much of the heap needs to be free after recovery cycles, "   \
454           "either Degenerated or Full GC to be claimed successful. If this "\
455           "much space is not available, next recovery step would be "       \
456           "triggered.")                                                     \
457           range(0, 100)                                                     \
458                                                                             \
459   product(bool, ShenandoahDegeneratedGC, true, DIAGNOSTIC,                  \
460           "Enable Degenerated GC as the graceful degradation step. "        \
461           "Disabling this option leads to degradation to Full GC instead. " \
462           "When running in passive mode, this can be toggled to measure "   \
463           "either Degenerated GC or Full GC costs.")                        \
464                                                                             \
465   product(uintx, ShenandoahFullGCThreshold, 3, EXPERIMENTAL,                \
466           "How many back-to-back Degenerated GCs should happen before "     \
467           "going to a Full GC.")                                            \
468                                                                             \
469   product(uintx, ShenandoahNoProgressThreshold, 5, EXPERIMENTAL,            \
470           "After this number of consecutive Full GCs fail to make "         \
471           "progress, Shenandoah will raise out of memory errors. Note "     \
472           "that progress is determined by ShenandoahCriticalFreeThreshold") \
473                                                                             \
474   product(bool, ShenandoahImplicitGCInvokesConcurrent, false, EXPERIMENTAL, \
475           "Should internally-caused GC requests invoke concurrent cycles, " \
476           "should they do the stop-the-world (Degenerated / Full GC)? "     \
477           "Many heuristics automatically enable this. This option is "      \
478           "similar to global ExplicitGCInvokesConcurrent.")                 \
479                                                                             \
480   product(bool, ShenandoahHumongousMoves, true, DIAGNOSTIC,                 \
481           "Allow moving humongous regions. This makes GC more resistant "   \
482           "to external fragmentation that may otherwise fail other "        \
483           "humongous allocations, at the expense of higher GC copying "     \
484           "costs. Currently affects stop-the-world (Full) cycle only.")     \
485                                                                             \
486   product(bool, ShenandoahOOMDuringEvacALot, false, DIAGNOSTIC,             \
487           "Testing: simulate OOM during evacuation.")                       \
488                                                                             \
489   product(bool, ShenandoahAllocFailureALot, false, DIAGNOSTIC,              \
490           "Testing: make lots of artificial allocation failures.")          \
491                                                                             \
492   product(uintx, ShenandoahCoalesceChance, 0, DIAGNOSTIC,                   \
493           "Testing: Abandon remaining mixed collections with this "         \
494           "likelihood. Following each mixed collection, abandon all "       \
495           "remaining mixed collection candidate regions with likelihood "   \
496           "ShenandoahCoalesceChance. Abandoning a mixed collection will "   \
497           "cause the old regions to be made parsable, rather than being "   \
498           "evacuated.")                                                     \
499           range(0, 100)                                                     \
500                                                                             \
501   product(intx, ShenandoahMarkScanPrefetch, 32, EXPERIMENTAL,               \
502           "How many objects to prefetch ahead when traversing mark bitmaps."\
503           "Set to 0 to disable prefetching.")                               \
504           range(0, 256)                                                     \
505                                                                             \
506   product(uintx, ShenandoahMarkLoopStride, 1000, EXPERIMENTAL,              \
507           "How many items to process during one marking iteration before "  \
508           "checking for cancellation, yielding, etc. Larger values improve "\
509           "marking performance at expense of responsiveness.")              \
510                                                                             \
511   product(uintx, ShenandoahParallelRegionStride, 1024, EXPERIMENTAL,        \
512           "How many regions to process at once during parallel region "     \
513           "iteration. Affects heaps with lots of regions.")                 \
514                                                                             \
515   product(size_t, ShenandoahSATBBufferSize, 1 * K, EXPERIMENTAL,            \
516           "Number of entries in an SATB log buffer.")                       \
517           range(1, max_uintx)                                               \
518                                                                             \
519   product(uintx, ShenandoahMaxSATBBufferFlushes, 5, EXPERIMENTAL,           \
520           "How many times to maximum attempt to flush SATB buffers at the " \
521           "end of concurrent marking.")                                     \
522                                                                             \
523   product(bool, ShenandoahSATBBarrier, true, DIAGNOSTIC,                    \
524           "Turn on/off SATB barriers in Shenandoah")                        \
525                                                                             \
526   product(bool, ShenandoahIUBarrier, false, DIAGNOSTIC,                     \
527           "Turn on/off I-U barriers barriers in Shenandoah")                \
528                                                                             \
529   product(bool, ShenandoahCardBarrier, false, DIAGNOSTIC,                   \
530           "Turn on/off card-marking post-write barrier in Shenandoah: "     \
531           " true when ShenandoahGCMode is generational, false otherwise")   \
532                                                                             \
533   product(bool, ShenandoahCASBarrier, true, DIAGNOSTIC,                     \
534           "Turn on/off CAS barriers in Shenandoah")                         \
535                                                                             \
536   product(bool, ShenandoahCloneBarrier, true, DIAGNOSTIC,                   \
537           "Turn on/off clone barriers in Shenandoah")                       \
538                                                                             \
539   product(bool, ShenandoahLoadRefBarrier, true, DIAGNOSTIC,                 \
540           "Turn on/off load-reference barriers in Shenandoah")              \
541                                                                             \
542   product(bool, ShenandoahStackWatermarkBarrier, true, DIAGNOSTIC,          \
543           "Turn on/off stack watermark barriers in Shenandoah")             \
544                                                                             \
545   develop(bool, ShenandoahVerifyOptoBarriers, trueInDebug,                  \
546           "Verify no missing barriers in C2.")                              \
547                                                                             \
548   product(uintx, ShenandoahOldCompactionReserve, 8, EXPERIMENTAL,           \
549           "During generational GC, prevent promotions from filling "        \
550           "this number of heap regions.  These regions are reserved "       \
551           "for the purpose of supporting compaction of old-gen "            \
552           "memory.  Otherwise, old-gen memory cannot be compacted.")        \
553           range(0, 128)                                                     \
554                                                                             \
555   product(bool, ShenandoahAllowOldMarkingPreemption, true, DIAGNOSTIC,      \
556           "Allow young generation collections to suspend concurrent"        \
557           " marking in the old generation.")                                \
558                                                                             \
559   product(uintx, ShenandoahAgingCyclePeriod, 1, EXPERIMENTAL,               \
560           "With generational mode, increment the age of objects and"        \
561           "regions each time this many young-gen GC cycles are completed.") \
562                                                                             \
563   notproduct(bool, ShenandoahEnableCardStats, false,                        \
564           "Enable statistics collection related to clean & dirty cards")    \
565                                                                             \
566   notproduct(int, ShenandoahCardStatsLogInterval, 50,                       \
567           "Log cumulative card stats every so many remembered set or "      \
568           "update refs scans")                                              \
569                                                                             \
570   product(uintx, ShenandoahMinimumOldMarkTimeMs, 100, EXPERIMENTAL,         \
571          "Minimum amount of time in milliseconds to run old marking "       \
572          "before a young collection is allowed to run. This is intended "   \
573          "to prevent starvation of the old collector. Setting this to "     \
574          "0 will allow back to back young collections to run during old "   \
575          "marking.")                                                        \
576   // end of GC_SHENANDOAH_FLAGS
577 
578 #endif // SHARE_GC_SHENANDOAH_SHENANDOAH_GLOBALS_HPP
< prev index next >