1 /*
  2  * Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
  3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  4  *
  5  * This code is free software; you can redistribute it and/or modify it
  6  * under the terms of the GNU General Public License version 2 only, as
  7  * published by the Free Software Foundation.
  8  *
  9  * This code is distributed in the hope that it will be useful, but WITHOUT
 10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 12  * version 2 for more details (a copy is included in the LICENSE file that
 13  * accompanied this code).
 14  *
 15  * You should have received a copy of the GNU General Public License version
 16  * 2 along with this work; if not, write to the Free Software Foundation,
 17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 18  *
 19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 20  * or visit www.oracle.com if you need additional information or have any
 21  * questions.
 22  *
 23  */
 24 
 25 #ifndef SHARE_GC_SHARED_GC_GLOBALS_HPP
 26 #define SHARE_GC_SHARED_GC_GLOBALS_HPP
 27 
 28 #include "runtime/globals_shared.hpp"
 29 #include "utilities/macros.hpp"
 30 #if INCLUDE_EPSILONGC
 31 #include "gc/epsilon/epsilon_globals.hpp"
 32 #endif
 33 #if INCLUDE_G1GC
 34 #include "gc/g1/g1_globals.hpp"
 35 #endif
 36 #if INCLUDE_PARALLELGC
 37 #include "gc/parallel/parallel_globals.hpp"
 38 #endif
 39 #if INCLUDE_SERIALGC
 40 #include "gc/serial/serial_globals.hpp"
 41 #endif
 42 #if INCLUDE_SHENANDOAHGC
 43 #include "gc/shenandoah/shenandoah_globals.hpp"
 44 #endif
 45 #if INCLUDE_ZGC
 46 #include "gc/z/z_globals.hpp"
 47 #endif
 48 
 49 #define GC_FLAGS(develop,                                                   \
 50                  develop_pd,                                                \
 51                  product,                                                   \
 52                  product_pd,                                                \
 53                  notproduct,                                                \
 54                  range,                                                     \
 55                  constraint)                                                \
 56                                                                             \
 57   EPSILONGC_ONLY(GC_EPSILON_FLAGS(                                          \
 58     develop,                                                                \
 59     develop_pd,                                                             \
 60     product,                                                                \
 61     product_pd,                                                             \
 62     notproduct,                                                             \
 63     range,                                                                  \
 64     constraint))                                                            \
 65                                                                             \
 66   G1GC_ONLY(GC_G1_FLAGS(                                                    \
 67     develop,                                                                \
 68     develop_pd,                                                             \
 69     product,                                                                \
 70     product_pd,                                                             \
 71     notproduct,                                                             \
 72     range,                                                                  \
 73     constraint))                                                            \
 74                                                                             \
 75   PARALLELGC_ONLY(GC_PARALLEL_FLAGS(                                        \
 76     develop,                                                                \
 77     develop_pd,                                                             \
 78     product,                                                                \
 79     product_pd,                                                             \
 80     notproduct,                                                             \
 81     range,                                                                  \
 82     constraint))                                                            \
 83                                                                             \
 84   SERIALGC_ONLY(GC_SERIAL_FLAGS(                                            \
 85     develop,                                                                \
 86     develop_pd,                                                             \
 87     product,                                                                \
 88     product_pd,                                                             \
 89     notproduct,                                                             \
 90     range,                                                                  \
 91     constraint))                                                            \
 92                                                                             \
 93   SHENANDOAHGC_ONLY(GC_SHENANDOAH_FLAGS(                                    \
 94     develop,                                                                \
 95     develop_pd,                                                             \
 96     product,                                                                \
 97     product_pd,                                                             \
 98     notproduct,                                                             \
 99     range,                                                                  \
100     constraint))                                                            \
101                                                                             \
102   ZGC_ONLY(GC_Z_FLAGS(                                                      \
103     develop,                                                                \
104     develop_pd,                                                             \
105     product,                                                                \
106     product_pd,                                                             \
107     notproduct,                                                             \
108     range,                                                                  \
109     constraint))                                                            \
110                                                                             \
111   /* gc */                                                                  \
112                                                                             \
113   product(bool, UseSerialGC, false,                                         \
114           "Use the Serial garbage collector")                               \
115                                                                             \
116   product(bool, UseG1GC, false,                                             \
117           "Use the Garbage-First garbage collector")                        \
118                                                                             \
119   product(bool, UseParallelGC, false,                                       \
120           "Use the Parallel garbage collector.")                            \
121                                                                             \
122   product(bool, UseEpsilonGC, false, EXPERIMENTAL,                          \
123           "Use the Epsilon (no-op) garbage collector")                      \
124                                                                             \
125   product(bool, UseZGC, false,                                              \
126           "Use the Z garbage collector")                                    \
127                                                                             \
128   product(bool, UseShenandoahGC, false,                                     \
129           "Use the Shenandoah garbage collector")                           \
130                                                                             \
131   product(uint, ParallelGCThreads, 0,                                       \
132           "Number of parallel threads parallel gc will use")                \
133           constraint(ParallelGCThreadsConstraintFunc,AfterErgo)             \
134                                                                             \
135   product(bool, UseDynamicNumberOfGCThreads, true,                          \
136           "Dynamically choose the number of threads up to a maximum of "    \
137           "ParallelGCThreads parallel collectors will use for garbage "     \
138           "collection work")                                                \
139                                                                             \
140   product(bool, InjectGCWorkerCreationFailure, false, DIAGNOSTIC,           \
141              "Inject thread creation failures for "                         \
142              "UseDynamicNumberOfGCThreads")                                 \
143                                                                             \
144   product(size_t, HeapSizePerGCThread, ScaleForWordSize(32*M),              \
145           "Size of heap (bytes) per GC thread used in calculating the "     \
146           "number of GC threads")                                           \
147           constraint(VMPageSizeConstraintFunc, AtParse)                     \
148                                                                             \
149   product(uint, ConcGCThreads, 0,                                           \
150           "Number of threads concurrent gc will use")                       \
151           constraint(ConcGCThreadsConstraintFunc,AfterErgo)                 \
152                                                                             \
153   product(bool, AlwaysTenure, false,                                        \
154           "Always tenure objects in eden (ParallelGC only)")                \
155                                                                             \
156   product(bool, NeverTenure, false,                                         \
157           "Never tenure objects in eden, may tenure on overflow "           \
158           "(ParallelGC only)")                                              \
159                                                                             \
160   product(bool, ScavengeBeforeFullGC, true,                                 \
161           "Scavenge youngest generation before each full GC.")              \
162                                                                             \
163   product(bool, ExplicitGCInvokesConcurrent, false,                         \
164           "A System.gc() request invokes a concurrent collection; "         \
165           "(effective only when using concurrent collectors)")              \
166                                                                             \
167   product(uintx, GCLockerEdenExpansionPercent, 5,                           \
168           "How much the GC can expand the eden by while the GC locker "     \
169           "is active (as a percentage)")                                    \
170           range(0, 100)                                                     \
171                                                                             \
172   product(uintx, GCLockerRetryAllocationCount, 2, DIAGNOSTIC,               \
173           "Number of times to retry allocations when "                      \
174           "blocked by the GC locker")                                       \
175           range(0, max_uintx)                                               \
176                                                                             \
177   product(uintx, ParallelGCBufferWastePct, 10,                              \
178           "Wasted fraction of parallel allocation buffer")                  \
179           range(0, 100)                                                     \
180                                                                             \
181   product(uintx, TargetPLABWastePct, 10,                                    \
182           "Target wasted space in last buffer as percent of overall "       \
183           "allocation")                                                     \
184           range(1, 100)                                                     \
185                                                                             \
186   product(uintx, PLABWeight, 75,                                            \
187           "Percentage (0-100) used to weight the current sample when "      \
188           "computing exponentially decaying average for ResizePLAB")        \
189           range(0, 100)                                                     \
190                                                                             \
191   product(bool, ResizePLAB, true,                                           \
192           "Dynamically resize (survivor space) promotion LAB's")            \
193                                                                             \
194   product(int, ParGCArrayScanChunk, 50,                                     \
195           "Scan a subset of object array and push remainder, if array is "  \
196           "bigger than this")                                               \
197           range(1, max_jint/3)                                              \
198                                                                             \
199                                                                             \
200   product(bool, AlwaysPreTouch, false,                                      \
201           "Force all freshly committed pages to be pre-touched")            \
202                                                                             \
203   product_pd(size_t, PreTouchParallelChunkSize,                             \
204           "Per-thread chunk size for parallel memory pre-touch.")           \
205           range(4*K, SIZE_MAX / 2)                                          \
206                                                                             \
207   /* where does the range max value of (max_jint - 1) come from? */         \
208   product(size_t, MarkStackSizeMax, NOT_LP64(4*M) LP64_ONLY(512*M),         \
209           "Maximum size of marking stack")                                  \
210           range(1, (max_jint - 1))                                          \
211                                                                             \
212   product(size_t, MarkStackSize, NOT_LP64(32*K) LP64_ONLY(4*M),             \
213           "Size of marking stack")                                          \
214           constraint(MarkStackSizeConstraintFunc,AfterErgo)                 \
215           range(1, (max_jint - 1))                                          \
216                                                                             \
217   product(intx, RefDiscoveryPolicy, 0,                                      \
218           "Select type of reference discovery policy: "                     \
219           "reference-based(0) or referent-based(1)")                        \
220           range(ReferenceProcessor::DiscoveryPolicyMin,                     \
221                 ReferenceProcessor::DiscoveryPolicyMax)                     \
222                                                                             \
223   product(bool, ParallelRefProcEnabled, false,                              \
224           "Enable parallel reference processing whenever possible")         \
225                                                                             \
226   product(bool, ParallelRefProcBalancingEnabled, true,                      \
227           "Enable balancing of reference processing queues")                \
228                                                                             \
229   product(size_t, ReferencesPerThread, 1000, EXPERIMENTAL,                  \
230                "Ergonomically start one thread for this amount of "         \
231                "references for reference processing if "                    \
232                "ParallelRefProcEnabled is true. Specify 0 to disable and "  \
233                "use all threads.")                                          \
234                                                                             \
235   product(uintx, InitiatingHeapOccupancyPercent, 45,                        \
236           "The percent occupancy (IHOP) of the current old generation "     \
237           "capacity above which a concurrent mark cycle will be initiated " \
238           "Its value may change over time if adaptive IHOP is enabled, "    \
239           "otherwise the value remains constant. "                          \
240           "In the latter case a value of 0 will result as frequent as "     \
241           "possible concurrent marking cycles. A value of 100 disables "    \
242           "concurrent marking. "                                            \
243           "Fragmentation waste in the old generation is not considered "    \
244           "free space in this calculation. (G1 collector only)")            \
245           range(0, 100)                                                     \
246                                                                             \
247   notproduct(bool, ScavengeALot, false,                                     \
248           "Force scavenge at every Nth exit from the runtime system "       \
249           "(N=ScavengeALotInterval)")                                       \
250                                                                             \
251   develop(bool, FullGCALot, false,                                          \
252           "Force full gc at every Nth exit from the runtime system "        \
253           "(N=FullGCALotInterval)")                                         \
254                                                                             \
255   notproduct(bool, GCALotAtAllSafepoints, false,                            \
256           "Enforce ScavengeALot/GCALot at all potential safepoints")        \
257                                                                             \
258   notproduct(bool, PromotionFailureALot, false,                             \
259           "Use promotion failure handling on every youngest generation "    \
260           "collection")                                                     \
261                                                                             \
262   develop(uintx, PromotionFailureALotCount, 1000,                           \
263           "Number of promotion failures occurring at PLAB promotion "       \
264           "attempts at young collectors")                                   \
265                                                                             \
266   develop(uintx, PromotionFailureALotInterval, 5,                           \
267           "Total collections between promotion failures a lot")             \
268                                                                             \
269   product(uintx, WorkStealingSleepMillis, 1, EXPERIMENTAL,                  \
270           "Sleep time when sleep is used for yields")                       \
271                                                                             \
272   product(uintx, WorkStealingYieldsBeforeSleep, 5000, EXPERIMENTAL,         \
273           "Number of yields before a sleep is done during work stealing")   \
274                                                                             \
275   product(uintx, WorkStealingHardSpins, 4096, EXPERIMENTAL,                 \
276           "Number of iterations in a spin loop between checks on "          \
277           "time out of hard spin")                                          \
278                                                                             \
279   product(uintx, WorkStealingSpinToYieldRatio, 10, EXPERIMENTAL,            \
280           "Ratio of hard spins to calls to yield")                          \
281                                                                             \
282   develop(uintx, ObjArrayMarkingStride, 2048,                               \
283           "Number of object array elements to push onto the marking stack " \
284           "before pushing a continuation entry")                            \
285                                                                             \
286   develop(bool, MetadataAllocationFailALot, false,                          \
287           "Fail metadata allocations at intervals controlled by "           \
288           "MetadataAllocationFailALotInterval")                             \
289                                                                             \
290   develop(uintx, MetadataAllocationFailALotInterval, 1000,                  \
291           "Metadata allocation failure a lot interval")                     \
292                                                                             \
293   product_pd(bool, NeverActAsServerClassMachine,                            \
294           "Never act like a server-class machine")                          \
295                                                                             \
296   product(bool, AlwaysActAsServerClassMachine, false,                       \
297           "Always act like a server-class machine")                         \
298                                                                             \
299   product_pd(uint64_t, MaxRAM,                                              \
300           "Real memory size (in bytes) used to set maximum heap size")      \
301           range(0, 0XFFFFFFFFFFFFFFFF)                                      \
302                                                                             \
303   product(bool, AggressiveHeap, false,                                      \
304           "Optimize heap options for long-running memory intensive apps")   \
305                                                                             \
306   product(size_t, ErgoHeapSizeLimit, 0,                                     \
307           "Maximum ergonomically set heap size (in bytes); zero means use " \
308           "MaxRAM * MaxRAMPercentage / 100")                                \
309           range(0, max_uintx)                                               \
310                                                                             \
311   product(uintx, MaxRAMFraction, 4,                                         \
312           "Maximum fraction (1/n) of real memory used for maximum heap "    \
313           "size. "                                                          \
314           "Deprecated, use MaxRAMPercentage instead")                       \
315           range(1, max_uintx)                                               \
316                                                                             \
317   product(uintx, MinRAMFraction, 2,                                         \
318           "Minimum fraction (1/n) of real memory used for maximum heap "    \
319           "size on systems with small physical memory size. "               \
320           "Deprecated, use MinRAMPercentage instead")                       \
321           range(1, max_uintx)                                               \
322                                                                             \
323   product(uintx, InitialRAMFraction, 64,                                    \
324           "Fraction (1/n) of real memory used for initial heap size. "      \
325           "Deprecated, use InitialRAMPercentage instead")                   \
326           range(1, max_uintx)                                               \
327                                                                             \
328   product(double, MaxRAMPercentage, 25.0,                                   \
329           "Maximum percentage of real memory used for maximum heap size")   \
330           range(0.0, 100.0)                                                 \
331                                                                             \
332   product(double, MinRAMPercentage, 50.0,                                   \
333           "Minimum percentage of real memory used for maximum heap"         \
334           "size on systems with small physical memory size")                \
335           range(0.0, 100.0)                                                 \
336                                                                             \
337   product(double, InitialRAMPercentage, 1.5625,                             \
338           "Percentage of real memory used for initial heap size")           \
339           range(0.0, 100.0)                                                 \
340                                                                             \
341   product(int, ActiveProcessorCount, -1,                                    \
342           "Specify the CPU count the VM should use and report as active")   \
343                                                                             \
344   develop(uintx, MaxVirtMemFraction, 2,                                     \
345           "Maximum fraction (1/n) of virtual memory used for ergonomically "\
346           "determining maximum heap size")                                  \
347           range(1, max_uintx)                                               \
348                                                                             \
349   product(bool, UseAdaptiveSizePolicy, true,                                \
350           "Use adaptive generation sizing policies")                        \
351                                                                             \
352   product(bool, UsePSAdaptiveSurvivorSizePolicy, true,                      \
353           "Use adaptive survivor sizing policies")                          \
354                                                                             \
355   product(bool, UseAdaptiveGenerationSizePolicyAtMinorCollection, true,     \
356           "Use adaptive young-old sizing policies at minor collections")    \
357                                                                             \
358   product(bool, UseAdaptiveGenerationSizePolicyAtMajorCollection, true,     \
359           "Use adaptive young-old sizing policies at major collections")    \
360                                                                             \
361   product(bool, UseAdaptiveSizePolicyWithSystemGC, false,                   \
362           "Include statistics from System.gc() for adaptive size policy")   \
363                                                                             \
364   develop(intx, PSAdaptiveSizePolicyResizeVirtualSpaceAlot, -1,             \
365           "Resize the virtual spaces of the young or old generations")      \
366           range(-1, 1)                                                      \
367                                                                             \
368   product(uintx, AdaptiveSizeThroughPutPolicy, 0,                           \
369           "Policy for changing generation size for throughput goals")       \
370           range(0, 1)                                                       \
371                                                                             \
372   product(uintx, AdaptiveSizePolicyInitializingSteps, 20,                   \
373           "Number of steps where heuristics is used before data is used")   \
374           range(0, max_uintx)                                               \
375                                                                             \
376   develop(uintx, AdaptiveSizePolicyReadyThreshold, 5,                       \
377           "Number of collections before the adaptive sizing is started")    \
378                                                                             \
379   product(uintx, AdaptiveSizePolicyOutputInterval, 0,                       \
380           "Collection interval for printing information; zero means never") \
381           range(0, max_uintx)                                               \
382                                                                             \
383   product(bool, UseAdaptiveSizePolicyFootprintGoal, true,                   \
384           "Use adaptive minimum footprint as a goal")                       \
385                                                                             \
386   product(uintx, AdaptiveSizePolicyWeight, 10,                              \
387           "Weight given to exponential resizing, between 0 and 100")        \
388           range(0, 100)                                                     \
389                                                                             \
390   product(uintx, AdaptiveTimeWeight,       25,                              \
391           "Weight given to time in adaptive policy, between 0 and 100")     \
392           range(0, 100)                                                     \
393                                                                             \
394   product(uintx, PausePadding, 1,                                           \
395           "How much buffer to keep for pause time")                         \
396           range(0, max_juint)                                               \
397                                                                             \
398   product(uintx, PromotedPadding, 3,                                        \
399           "How much buffer to keep for promotion failure")                  \
400           range(0, max_juint)                                               \
401                                                                             \
402   product(uintx, SurvivorPadding, 3,                                        \
403           "How much buffer to keep for survivor overflow")                  \
404           range(0, max_juint)                                               \
405                                                                             \
406   product(uintx, ThresholdTolerance, 10,                                    \
407           "Allowed collection cost difference between generations")         \
408           range(0, 100)                                                     \
409                                                                             \
410   product(uintx, AdaptiveSizePolicyCollectionCostMargin, 50,                \
411           "If collection costs are within margin, reduce both by full "     \
412           "delta")                                                          \
413           range(0, 100)                                                     \
414                                                                             \
415   product(uintx, YoungGenerationSizeIncrement, 20,                          \
416           "Adaptive size percentage change in young generation")            \
417           range(0, 100)                                                     \
418                                                                             \
419   product(uintx, YoungGenerationSizeSupplement, 80,                         \
420           "Supplement to YoungedGenerationSizeIncrement used at startup")   \
421           range(0, 100)                                                     \
422                                                                             \
423   product(uintx, YoungGenerationSizeSupplementDecay, 8,                     \
424           "Decay factor to YoungedGenerationSizeSupplement")                \
425           range(1, max_uintx)                                               \
426                                                                             \
427   product(uintx, TenuredGenerationSizeIncrement, 20,                        \
428           "Adaptive size percentage change in tenured generation")          \
429           range(0, 100)                                                     \
430                                                                             \
431   product(uintx, TenuredGenerationSizeSupplement, 80,                       \
432           "Supplement to TenuredGenerationSizeIncrement used at startup")   \
433           range(0, 100)                                                     \
434                                                                             \
435   product(uintx, TenuredGenerationSizeSupplementDecay, 2,                   \
436           "Decay factor to TenuredGenerationSizeIncrement")                 \
437           range(1, max_uintx)                                               \
438                                                                             \
439   product(uintx, MaxGCPauseMillis, max_uintx - 1,                           \
440           "Adaptive size policy maximum GC pause time goal in millisecond, "\
441           "or (G1 Only) the maximum GC time per MMU time slice")            \
442           range(1, max_uintx - 1)                                           \
443           constraint(MaxGCPauseMillisConstraintFunc,AfterErgo)              \
444                                                                             \
445   product(uintx, GCPauseIntervalMillis, 0,                                  \
446           "Time slice for MMU specification")                               \
447           constraint(GCPauseIntervalMillisConstraintFunc,AfterErgo)         \
448                                                                             \
449   product(uintx, MaxGCMinorPauseMillis, max_uintx,                          \
450           "Adaptive size policy maximum GC minor pause time goal "          \
451           "in millisecond")                                                 \
452           range(0, max_uintx)                                               \
453                                                                             \
454   product(uintx, GCTimeRatio, 99,                                           \
455           "Adaptive size policy application time to GC time ratio")         \
456           range(0, max_juint)                                               \
457                                                                             \
458   product(uintx, AdaptiveSizeDecrementScaleFactor, 4,                       \
459           "Adaptive size scale down factor for shrinking")                  \
460           range(1, max_uintx)                                               \
461                                                                             \
462   product(bool, UseAdaptiveSizeDecayMajorGCCost, true,                      \
463           "Adaptive size decays the major cost for long major intervals")   \
464                                                                             \
465   product(uintx, AdaptiveSizeMajorGCDecayTimeScale, 10,                     \
466           "Time scale over which major costs decay")                        \
467           range(0, max_uintx)                                               \
468                                                                             \
469   product(uintx, MinSurvivorRatio, 3,                                       \
470           "Minimum ratio of young generation/survivor space size")          \
471           range(3, max_uintx)                                               \
472                                                                             \
473   product(uintx, InitialSurvivorRatio, 8,                                   \
474           "Initial ratio of young generation/survivor space size")          \
475           range(0, max_uintx)                                               \
476                                                                             \
477   product(size_t, BaseFootPrintEstimate, 256*M,                             \
478           "Estimate of footprint other than Java Heap")                     \
479           range(0, max_uintx)                                               \
480                                                                             \
481   product(bool, UseGCOverheadLimit, true,                                   \
482           "Use policy to limit of proportion of time spent in GC "          \
483           "before an OutOfMemory error is thrown")                          \
484                                                                             \
485   product(uintx, GCTimeLimit, 98,                                           \
486           "Limit of the proportion of time spent in GC before "             \
487           "an OutOfMemoryError is thrown (used with GCHeapFreeLimit)")      \
488           range(0, 100)                                                     \
489                                                                             \
490   product(uintx, GCHeapFreeLimit, 2,                                        \
491           "Minimum percentage of free space after a full GC before an "     \
492           "OutOfMemoryError is thrown (used with GCTimeLimit)")             \
493           range(0, 100)                                                     \
494                                                                             \
495   develop(uintx, GCOverheadLimitThreshold, 5,                               \
496           "Number of consecutive collections before gc time limit fires")   \
497           range(1, max_uintx)                                               \
498                                                                             \
499   product(intx, PrefetchCopyIntervalInBytes, -1,                            \
500           "How far ahead to prefetch destination area (<= 0 means off)")    \
501           range(-1, max_jint)                                               \
502                                                                             \
503   product(intx, PrefetchScanIntervalInBytes, -1,                            \
504           "How far ahead to prefetch scan area (<= 0 means off)")           \
505           range(-1, max_jint)                                               \
506                                                                             \
507   product(intx, PrefetchFieldsAhead, -1,                                    \
508           "How many fields ahead to prefetch in oop scan (<= 0 means off)") \
509           range(-1, max_jint)                                               \
510                                                                             \
511   product(bool, VerifyDuringStartup, false, DIAGNOSTIC,                     \
512           "Verify memory system before executing any Java code "            \
513           "during VM initialization")                                       \
514                                                                             \
515   product(bool, VerifyBeforeExit, trueInDebug, DIAGNOSTIC,                  \
516           "Verify system before exiting")                                   \
517                                                                             \
518   product(bool, VerifyBeforeGC, false, DIAGNOSTIC,                          \
519           "Verify memory system before GC")                                 \
520                                                                             \
521   product(bool, VerifyAfterGC, false, DIAGNOSTIC,                           \
522           "Verify memory system after GC")                                  \
523                                                                             \
524   product(bool, VerifyDuringGC, false, DIAGNOSTIC,                          \
525           "Verify memory system during GC (between phases)")                \
526                                                                             \
527   product(int, VerifyArchivedFields, 0, DIAGNOSTIC,                         \
528           "Verify memory when archived oop fields are loaded from CDS; "    \
529           "0: No check; "                                                   \
530           "1: Basic verification with VM_Verify (no side effects); "        \
531           "2: Detailed verification by forcing a GC (with side effects)")   \
532           range(0, 2)                                                       \
533                                                                             \
534   product(ccstrlist, VerifyGCType, "", DIAGNOSTIC,                          \
535              "GC type(s) to verify when Verify*GC is enabled."              \
536              "Available types are collector specific.")                     \
537                                                                             \
538   product(ccstrlist, VerifySubSet, "", DIAGNOSTIC,                          \
539           "Memory sub-systems to verify when Verify*GC flag(s) "            \
540           "are enabled. One or more sub-systems can be specified "          \
541           "in a comma separated string. Sub-systems are: "                  \
542           "threads, heap, symbol_table, string_table, codecache, "          \
543           "dictionary, classloader_data_graph, metaspace, jni_handles, "    \
544           "codecache_oops, resolved_method_table, stringdedup")             \
545                                                                             \
546   product(bool, GCParallelVerificationEnabled, true, DIAGNOSTIC,            \
547           "Enable parallel memory system verification")                     \
548                                                                             \
549   product(bool, DeferInitialCardMark, false, DIAGNOSTIC,                    \
550           "When +ReduceInitialCardMarks, explicitly defer any that "        \
551           "may arise from new_pre_store_barrier")                           \
552                                                                             \
553   product(bool, UseCondCardMark, false,                                     \
554           "Check for already marked card before updating card table")       \
555                                                                             \
556   product(bool, VerifyRememberedSets, false, DIAGNOSTIC,                    \
557           "Verify GC remembered sets")                                      \
558                                                                             \
559   product(bool, VerifyObjectStartArray, true, DIAGNOSTIC,                   \
560           "Verify GC object start array if verify before/after")            \
561                                                                             \
562   product(bool, DisableExplicitGC, false,                                   \
563           "Ignore calls to System.gc()")                                    \
564                                                                             \
565   product(bool, PrintGC, false,                                             \
566           "Print message at garbage collection. "                           \
567           "Deprecated, use -Xlog:gc instead.")                              \
568                                                                             \
569   product(bool, PrintGCDetails, false,                                      \
570           "Print more details at garbage collection. "                      \
571           "Deprecated, use -Xlog:gc* instead.")                             \
572                                                                             \
573   develop(intx, ConcGCYieldTimeout, 0,                                      \
574           "If non-zero, assert that GC threads yield within this "          \
575           "number of milliseconds")                                         \
576           range(0, max_intx)                                                \
577                                                                             \
578   notproduct(intx, ScavengeALotInterval,     1,                             \
579           "Interval between which scavenge will occur with +ScavengeALot")  \
580                                                                             \
581   notproduct(intx, FullGCALotInterval,     1,                               \
582           "Interval between which full gc will occur with +FullGCALot")     \
583                                                                             \
584   notproduct(intx, FullGCALotStart,     0,                                  \
585           "For which invocation to start FullGCAlot")                       \
586                                                                             \
587   notproduct(intx, FullGCALotDummies,  32*K,                                \
588           "Dummy object allocated with +FullGCALot, forcing all objects "   \
589           "to move")                                                        \
590                                                                             \
591   /* gc parameters */                                                       \
592   product(size_t, MinHeapSize, 0,                                           \
593           "Minimum heap size (in bytes); zero means use ergonomics")        \
594           constraint(MinHeapSizeConstraintFunc,AfterErgo)                   \
595                                                                             \
596   product(size_t, InitialHeapSize, 0,                                       \
597           "Initial heap size (in bytes); zero means use ergonomics")        \
598           constraint(InitialHeapSizeConstraintFunc,AfterErgo)               \
599                                                                             \
600   product(size_t, MaxHeapSize, ScaleForWordSize(96*M),                      \
601           "Maximum heap size (in bytes)")                                   \
602           constraint(MaxHeapSizeConstraintFunc,AfterErgo)                   \
603                                                                             \
604   product(size_t, SoftMaxHeapSize, 0, MANAGEABLE,                           \
605           "Soft limit for maximum heap size (in bytes)")                    \
606           constraint(SoftMaxHeapSizeConstraintFunc,AfterMemoryInit)         \
607                                                                             \
608   product(size_t, OldSize, ScaleForWordSize(4*M),                           \
609           "Initial tenured generation size (in bytes)")                     \
610           range(0, max_uintx)                                               \
611                                                                             \
612   product(size_t, NewSize, ScaleForWordSize(1*M),                           \
613           "Initial new generation size (in bytes)")                         \
614           constraint(NewSizeConstraintFunc,AfterErgo)                       \
615                                                                             \
616   product(size_t, MaxNewSize, max_uintx,                                    \
617           "Maximum new generation size (in bytes), max_uintx means set "    \
618           "ergonomically")                                                  \
619           range(0, max_uintx)                                               \
620                                                                             \
621   product_pd(size_t, HeapBaseMinAddress,                                    \
622           "OS specific low limit for heap base address")                    \
623           constraint(HeapBaseMinAddressConstraintFunc,AfterErgo)            \
624                                                                             \
625   product(size_t, PretenureSizeThreshold, 0,                                \
626           "Maximum size in bytes of objects allocated in DefNew "           \
627           "generation; zero means no maximum")                              \
628           range(0, max_uintx)                                               \
629                                                                             \
630   product(uintx, SurvivorRatio, 8,                                          \
631           "Ratio of eden/survivor space size")                              \
632           range(1, max_uintx-2)                                             \
633           constraint(SurvivorRatioConstraintFunc,AfterMemoryInit)           \
634                                                                             \
635   product(uintx, NewRatio, 2,                                               \
636           "Ratio of old/new generation sizes")                              \
637           range(0, max_uintx-1)                                             \
638                                                                             \
639   product_pd(size_t, NewSizeThreadIncrease,                                 \
640           "Additional size added to desired new generation size per "       \
641           "non-daemon thread (in bytes)")                                   \
642           range(0, max_uintx)                                               \
643                                                                             \
644   product(uintx, QueuedAllocationWarningCount, 0,                           \
645           "Number of times an allocation that queues behind a GC "          \
646           "will retry before printing a warning")                           \
647           range(0, max_uintx)                                               \
648                                                                             \
649   product(uintx, VerifyGCStartAt,   0, DIAGNOSTIC,                          \
650           "GC invoke count where +VerifyBefore/AfterGC kicks in")           \
651           range(0, max_uintx)                                               \
652                                                                             \
653   product(intx, VerifyGCLevel,     0, DIAGNOSTIC,                           \
654           "Generation level at which to start +VerifyBefore/AfterGC")       \
655           range(0, 1)                                                       \
656                                                                             \
657   product(uintx, MaxTenuringThreshold,    15,                               \
658           "Maximum value for tenuring threshold")                           \
659           range(0, markWord::max_age + 1)                                   \
660           constraint(MaxTenuringThresholdConstraintFunc,AfterErgo)          \
661                                                                             \
662   product(uintx, InitialTenuringThreshold,    7,                            \
663           "Initial value for tenuring threshold")                           \
664           range(0, markWord::max_age + 1)                                   \
665           constraint(InitialTenuringThresholdConstraintFunc,AfterErgo)      \
666                                                                             \
667   product(uintx, TargetSurvivorRatio,    50,                                \
668           "Desired percentage of survivor space used after scavenge")       \
669           range(0, 100)                                                     \
670                                                                             \
671   product(uintx, MarkSweepDeadRatio,     5,                                 \
672           "Percentage (0-100) of the old gen allowed as dead wood. "        \
673           "Serial mark sweep treats this as both the minimum and maximum "  \
674           "value. "                                                         \
675           "Par compact uses a variable scale based on the density of the "  \
676           "generation and treats this as the maximum value when the heap "  \
677           "is either completely full or completely empty.  Par compact "    \
678           "also has a smaller default value; see arguments.cpp. "           \
679           "G1 full gc treats this as an allowed garbage threshold to skip " \
680           "compaction of heap regions, i.e. if a heap region has less "     \
681           "garbage than this value, then the region will not be compacted"  \
682           "during G1 full GC.")                                             \
683           range(0, 100)                                                     \
684                                                                             \
685   product(uint, MarkSweepAlwaysCompactCount,     4,                         \
686           "How often should we fully compact the heap (ignoring the dead "  \
687           "space parameters)")                                              \
688           range(1, max_juint)                                               \
689                                                                             \
690   develop(uintx, GCExpandToAllocateDelayMillis, 0,                          \
691           "Delay between expansion and allocation (in milliseconds)")       \
692                                                                             \
693   product(uintx, GCDrainStackTargetSize, 64,                                \
694           "Number of entries we will try to leave on the stack "            \
695           "during parallel gc")                                             \
696           range(0, max_juint)
697 
698 // end of GC_FLAGS
699 
700 DECLARE_FLAGS(GC_FLAGS)
701 
702 #endif // SHARE_GC_SHARED_GC_GLOBALS_HPP