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