1 /*
  2  * Copyright (c) 1997, 2019, 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                  diagnostic,                                                \
 54                  diagnostic_pd,                                             \
 55                  experimental,                                              \
 56                  notproduct,                                                \
 57                  manageable,                                                \
 58                  product_rw,                                                \
 59                  lp64_product,                                              \
 60                  range,                                                     \
 61                  constraint,                                                \
 62                  writeable)                                                 \
 63                                                                             \
 64   EPSILONGC_ONLY(GC_EPSILON_FLAGS(                                          \
 65     develop,                                                                \
 66     develop_pd,                                                             \
 67     product,                                                                \
 68     product_pd,                                                             \
 69     diagnostic,                                                             \
 70     diagnostic_pd,                                                          \
 71     experimental,                                                           \
 72     notproduct,                                                             \
 73     manageable,                                                             \
 74     product_rw,                                                             \
 75     lp64_product,                                                           \
 76     range,                                                                  \
 77     constraint,                                                             \
 78     writeable))                                                             \
 79                                                                             \
 80   G1GC_ONLY(GC_G1_FLAGS(                                                    \
 81     develop,                                                                \
 82     develop_pd,                                                             \
 83     product,                                                                \
 84     product_pd,                                                             \
 85     diagnostic,                                                             \
 86     diagnostic_pd,                                                          \
 87     experimental,                                                           \
 88     notproduct,                                                             \
 89     manageable,                                                             \
 90     product_rw,                                                             \
 91     lp64_product,                                                           \
 92     range,                                                                  \
 93     constraint,                                                             \
 94     writeable))                                                             \
 95                                                                             \
 96   PARALLELGC_ONLY(GC_PARALLEL_FLAGS(                                        \
 97     develop,                                                                \
 98     develop_pd,                                                             \
 99     product,                                                                \
100     product_pd,                                                             \
101     diagnostic,                                                             \
102     diagnostic_pd,                                                          \
103     experimental,                                                           \
104     notproduct,                                                             \
105     manageable,                                                             \
106     product_rw,                                                             \
107     lp64_product,                                                           \
108     range,                                                                  \
109     constraint,                                                             \
110     writeable))                                                             \
111                                                                             \
112   SERIALGC_ONLY(GC_SERIAL_FLAGS(                                            \
113     develop,                                                                \
114     develop_pd,                                                             \
115     product,                                                                \
116     product_pd,                                                             \
117     diagnostic,                                                             \
118     diagnostic_pd,                                                          \
119     experimental,                                                           \
120     notproduct,                                                             \
121     manageable,                                                             \
122     product_rw,                                                             \
123     lp64_product,                                                           \
124     range,                                                                  \
125     constraint,                                                             \
126     writeable))                                                             \
127                                                                             \
128   SHENANDOAHGC_ONLY(GC_SHENANDOAH_FLAGS(                                    \
129     develop,                                                                \
130     develop_pd,                                                             \
131     product,                                                                \
132     product_pd,                                                             \
133     diagnostic,                                                             \
134     diagnostic_pd,                                                          \
135     experimental,                                                           \
136     notproduct,                                                             \
137     manageable,                                                             \
138     product_rw,                                                             \
139     lp64_product,                                                           \
140     range,                                                                  \
141     constraint,                                                             \
142     writeable))                                                             \
143                                                                             \
144   ZGC_ONLY(GC_Z_FLAGS(                                                      \
145     develop,                                                                \
146     develop_pd,                                                             \
147     product,                                                                \
148     product_pd,                                                             \
149     diagnostic,                                                             \
150     diagnostic_pd,                                                          \
151     experimental,                                                           \
152     notproduct,                                                             \
153     manageable,                                                             \
154     product_rw,                                                             \
155     lp64_product,                                                           \
156     range,                                                                  \
157     constraint,                                                             \
158     writeable))                                                             \
159                                                                             \
160   /* gc */                                                                  \
161                                                                             \
162   product(bool, UseSerialGC, false,                                         \
163           "Use the Serial garbage collector")                               \
164                                                                             \
165   product(bool, UseG1GC, false,                                             \
166           "Use the Garbage-First garbage collector")                        \
167                                                                             \
168   product(bool, UseParallelGC, false,                                       \
169           "Use the Parallel Scavenge garbage collector")                    \
170                                                                             \
171   product(bool, UseParallelOldGC, false,                                    \
172           "Use the Parallel Old garbage collector")                         \
173                                                                             \
174   experimental(bool, UseEpsilonGC, false,                                   \
175           "Use the Epsilon (no-op) garbage collector")                      \
176                                                                             \
177   experimental(bool, UseZGC, false,                                         \
178           "Use the Z garbage collector")                                    \
179                                                                             \
180   experimental(bool, UseShenandoahGC, false,                                \
181           "Use the Shenandoah garbage collector")                           \
182                                                                             \
183   product(uint, ParallelGCThreads, 0,                                       \
184           "Number of parallel threads parallel gc will use")                \
185           constraint(ParallelGCThreadsConstraintFunc,AfterErgo)             \
186                                                                             \
187   diagnostic(bool, UseSemaphoreGCThreadsSynchronization, true,              \
188             "Use semaphore synchronization for the GC Threads, "            \
189             "instead of synchronization based on mutexes")                  \
190                                                                             \
191   product(bool, UseDynamicNumberOfGCThreads, true,                          \
192           "Dynamically choose the number of threads up to a maximum of "    \
193           "ParallelGCThreads parallel collectors will use for garbage "     \
194           "collection work")                                                \
195                                                                             \
196   diagnostic(bool, InjectGCWorkerCreationFailure, false,                    \
197              "Inject thread creation failures for "                         \
198              "UseDynamicNumberOfGCThreads")                                 \
199                                                                             \
200   diagnostic(bool, ForceDynamicNumberOfGCThreads, false,                    \
201           "Force dynamic selection of the number of "                       \
202           "parallel threads parallel gc will use to aid debugging")         \
203                                                                             \
204   product(size_t, HeapSizePerGCThread, ScaleForWordSize(32*M),              \
205           "Size of heap (bytes) per GC thread used in calculating the "     \
206           "number of GC threads")                                           \
207           range((size_t)os::vm_page_size(), (size_t)max_uintx)              \
208                                                                             \
209   product(uint, ConcGCThreads, 0,                                           \
210           "Number of threads concurrent gc will use")                       \
211           constraint(ConcGCThreadsConstraintFunc,AfterErgo)                 \
212                                                                             \
213   product(uint, GCTaskTimeStampEntries, 200,                                \
214           "Number of time stamp entries per gc worker thread")              \
215           range(1, max_jint)                                                \
216                                                                             \
217   product(bool, AlwaysTenure, false,                                        \
218           "Always tenure objects in eden (ParallelGC only)")                \
219                                                                             \
220   product(bool, NeverTenure, false,                                         \
221           "Never tenure objects in eden, may tenure on overflow "           \
222           "(ParallelGC only)")                                              \
223                                                                             \
224   product(bool, ScavengeBeforeFullGC, true,                                 \
225           "Scavenge youngest generation before each full GC.")              \
226                                                                             \
227   product(bool, ExplicitGCInvokesConcurrent, false,                         \
228           "A System.gc() request invokes a concurrent collection; "         \
229           "(effective only when using concurrent collectors)")              \
230                                                                             \
231   product(uintx, GCLockerEdenExpansionPercent, 5,                           \
232           "How much the GC can expand the eden by while the GC locker "     \
233           "is active (as a percentage)")                                    \
234           range(0, 100)                                                     \
235                                                                             \
236   diagnostic(uintx, GCLockerRetryAllocationCount, 2,                        \
237           "Number of times to retry allocations when "                      \
238           "blocked by the GC locker")                                       \
239           range(0, max_uintx)                                               \
240                                                                             \
241   product(uintx, ParallelGCBufferWastePct, 10,                              \
242           "Wasted fraction of parallel allocation buffer")                  \
243           range(0, 100)                                                     \
244                                                                             \
245   product(uintx, TargetPLABWastePct, 10,                                    \
246           "Target wasted space in last buffer as percent of overall "       \
247           "allocation")                                                     \
248           range(1, 100)                                                     \
249                                                                             \
250   product(uintx, PLABWeight, 75,                                            \
251           "Percentage (0-100) used to weight the current sample when "      \
252           "computing exponentially decaying average for ResizePLAB")        \
253           range(0, 100)                                                     \
254                                                                             \
255   product(bool, ResizePLAB, true,                                           \
256           "Dynamically resize (survivor space) promotion LAB's")            \
257                                                                             \
258   product(int, ParGCArrayScanChunk, 50,                                     \
259           "Scan a subset of object array and push remainder, if array is "  \
260           "bigger than this")                                               \
261           range(1, max_jint/3)                                              \
262                                                                             \
263                                                                             \
264   product(bool, AlwaysPreTouch, false,                                      \
265           "Force all freshly committed pages to be pre-touched")            \
266                                                                             \
267   product(size_t, PreTouchParallelChunkSize, 1 * G,                         \
268           "Per-thread chunk size for parallel memory pre-touch.")           \
269           range(1, SIZE_MAX / 2)                                            \
270                                                                             \
271   /* where does the range max value of (max_jint - 1) come from? */         \
272   product(size_t, MarkStackSizeMax, NOT_LP64(4*M) LP64_ONLY(512*M),         \
273           "Maximum size of marking stack")                                  \
274           range(1, (max_jint - 1))                                          \
275                                                                             \
276   product(size_t, MarkStackSize, NOT_LP64(32*K) LP64_ONLY(4*M),             \
277           "Size of marking stack")                                          \
278           constraint(MarkStackSizeConstraintFunc,AfterErgo)                 \
279                                                                             \
280   product(intx, RefDiscoveryPolicy, 0,                                      \
281           "Select type of reference discovery policy: "                     \
282           "reference-based(0) or referent-based(1)")                        \
283           range(ReferenceProcessor::DiscoveryPolicyMin,                     \
284                 ReferenceProcessor::DiscoveryPolicyMax)                     \
285                                                                             \
286   product(bool, ParallelRefProcEnabled, false,                              \
287           "Enable parallel reference processing whenever possible")         \
288                                                                             \
289   product(bool, ParallelRefProcBalancingEnabled, true,                      \
290           "Enable balancing of reference processing queues")                \
291                                                                             \
292   experimental(size_t, ReferencesPerThread, 1000,                           \
293                "Ergonomically start one thread for this amount of "         \
294                "references for reference processing if "                    \
295                "ParallelRefProcEnabled is true. Specify 0 to disable and "  \
296                "use all threads.")                                          \
297                                                                             \
298   product(uintx, InitiatingHeapOccupancyPercent, 45,                        \
299           "The percent occupancy (IHOP) of the current old generation "     \
300           "capacity above which a concurrent mark cycle will be initiated " \
301           "Its value may change over time if adaptive IHOP is enabled, "    \
302           "otherwise the value remains constant. "                          \
303           "In the latter case a value of 0 will result as frequent as "     \
304           "possible concurrent marking cycles. A value of 100 disables "    \
305           "concurrent marking. "                                            \
306           "Fragmentation waste in the old generation is not considered "    \
307           "free space in this calculation. (G1 collector only)")            \
308           range(0, 100)                                                     \
309                                                                             \
310   notproduct(bool, ScavengeALot, false,                                     \
311           "Force scavenge at every Nth exit from the runtime system "       \
312           "(N=ScavengeALotInterval)")                                       \
313                                                                             \
314   develop(bool, FullGCALot, false,                                          \
315           "Force full gc at every Nth exit from the runtime system "        \
316           "(N=FullGCALotInterval)")                                         \
317                                                                             \
318   notproduct(bool, GCALotAtAllSafepoints, false,                            \
319           "Enforce ScavengeALot/GCALot at all potential safepoints")        \
320                                                                             \
321   notproduct(bool, PromotionFailureALot, false,                             \
322           "Use promotion failure handling on every youngest generation "    \
323           "collection")                                                     \
324                                                                             \
325   develop(uintx, PromotionFailureALotCount, 1000,                           \
326           "Number of promotion failures occurring at PLAB promotion "       \
327           "attempts at young collectors")                                   \
328                                                                             \
329   develop(uintx, PromotionFailureALotInterval, 5,                           \
330           "Total collections between promotion failures a lot")             \
331                                                                             \
332   diagnostic(bool, UseOWSTTaskTerminator, true,                             \
333           "Use Optimized Work Stealing Threads task termination "           \
334           "protocol")                                                       \
335                                                                             \
336   experimental(uintx, WorkStealingSleepMillis, 1,                           \
337           "Sleep time when sleep is used for yields")                       \
338                                                                             \
339   experimental(uintx, WorkStealingYieldsBeforeSleep, 5000,                  \
340           "Number of yields before a sleep is done during work stealing")   \
341                                                                             \
342   experimental(uintx, WorkStealingHardSpins, 4096,                          \
343           "Number of iterations in a spin loop between checks on "          \
344           "time out of hard spin")                                          \
345                                                                             \
346   experimental(uintx, WorkStealingSpinToYieldRatio, 10,                     \
347           "Ratio of hard spins to calls to yield")                          \
348                                                                             \
349   develop(uintx, ObjArrayMarkingStride, 2048,                               \
350           "Number of object array elements to push onto the marking stack " \
351           "before pushing a continuation entry")                            \
352                                                                             \
353   develop(bool, MetadataAllocationFailALot, false,                          \
354           "Fail metadata allocations at intervals controlled by "           \
355           "MetadataAllocationFailALotInterval")                             \
356                                                                             \
357   develop(uintx, MetadataAllocationFailALotInterval, 1000,                  \
358           "Metadata allocation failure a lot interval")                     \
359                                                                             \
360   product(bool, ExecutingUnitTests, false,                                  \
361           "Whether the JVM is running unit tests or not")                   \
362                                                                             \
363   product_pd(bool, UseTLAB, "Use thread-local object allocation")           \
364                                                                             \
365   product_pd(bool, ResizeTLAB,                                              \
366           "Dynamically resize TLAB size for threads")                       \
367                                                                             \
368   product(bool, ZeroTLAB, false,                                            \
369           "Zero out the newly created TLAB")                                \
370                                                                             \
371   product(bool, TLABStats, true,                                            \
372           "Provide more detailed and expensive TLAB statistics.")           \
373                                                                             \
374   product_pd(bool, NeverActAsServerClassMachine,                            \
375           "Never act like a server-class machine")                          \
376                                                                             \
377   product(bool, AlwaysActAsServerClassMachine, false,                       \
378           "Always act like a server-class machine")                         \
379                                                                             \
380   product_pd(uint64_t, MaxRAM,                                              \
381           "Real memory size (in bytes) used to set maximum heap size")      \
382           range(0, 0XFFFFFFFFFFFFFFFF)                                      \
383                                                                             \
384   product(bool, AggressiveHeap, false,                                      \
385           "Optimize heap options for long-running memory intensive apps")   \
386                                                                             \
387   product(size_t, ErgoHeapSizeLimit, 0,                                     \
388           "Maximum ergonomically set heap size (in bytes); zero means use " \
389           "MaxRAM * MaxRAMPercentage / 100")                                \
390           range(0, max_uintx)                                               \
391                                                                             \
392   product(uintx, MaxRAMFraction, 4,                                         \
393           "Maximum fraction (1/n) of real memory used for maximum heap "    \
394           "size. "                                                          \
395           "Deprecated, use MaxRAMPercentage instead")                       \
396           range(1, max_uintx)                                               \
397                                                                             \
398   product(uintx, MinRAMFraction, 2,                                         \
399           "Minimum fraction (1/n) of real memory used for maximum heap "    \
400           "size on systems with small physical memory size. "               \
401           "Deprecated, use MinRAMPercentage instead")                       \
402           range(1, max_uintx)                                               \
403                                                                             \
404   product(uintx, InitialRAMFraction, 64,                                    \
405           "Fraction (1/n) of real memory used for initial heap size. "      \
406           "Deprecated, use InitialRAMPercentage instead")                   \
407           range(1, max_uintx)                                               \
408                                                                             \
409   product(double, MaxRAMPercentage, 25.0,                                   \
410           "Maximum percentage of real memory used for maximum heap size")   \
411           range(0.0, 100.0)                                                 \
412                                                                             \
413   product(double, MinRAMPercentage, 50.0,                                   \
414           "Minimum percentage of real memory used for maximum heap"         \
415           "size on systems with small physical memory size")                \
416           range(0.0, 100.0)                                                 \
417                                                                             \
418   product(double, InitialRAMPercentage, 1.5625,                             \
419           "Percentage of real memory used for initial heap size")           \
420           range(0.0, 100.0)                                                 \
421                                                                             \
422   product(int, ActiveProcessorCount, -1,                                    \
423           "Specify the CPU count the VM should use and report as active")   \
424                                                                             \
425   develop(uintx, MaxVirtMemFraction, 2,                                     \
426           "Maximum fraction (1/n) of virtual memory used for ergonomically "\
427           "determining maximum heap size")                                  \
428                                                                             \
429   product(bool, UseAdaptiveSizePolicy, true,                                \
430           "Use adaptive generation sizing policies")                        \
431                                                                             \
432   product(bool, UsePSAdaptiveSurvivorSizePolicy, true,                      \
433           "Use adaptive survivor sizing policies")                          \
434                                                                             \
435   product(bool, UseAdaptiveGenerationSizePolicyAtMinorCollection, true,     \
436           "Use adaptive young-old sizing policies at minor collections")    \
437                                                                             \
438   product(bool, UseAdaptiveGenerationSizePolicyAtMajorCollection, true,     \
439           "Use adaptive young-old sizing policies at major collections")    \
440                                                                             \
441   product(bool, UseAdaptiveSizePolicyWithSystemGC, false,                   \
442           "Include statistics from System.gc() for adaptive size policy")   \
443                                                                             \
444   product(bool, UseAdaptiveGCBoundary, false,                               \
445           "Allow young-old boundary to move")                               \
446                                                                             \
447   develop(intx, PSAdaptiveSizePolicyResizeVirtualSpaceAlot, -1,             \
448           "Resize the virtual spaces of the young or old generations")      \
449           range(-1, 1)                                                      \
450                                                                             \
451   product(uintx, AdaptiveSizeThroughPutPolicy, 0,                           \
452           "Policy for changing generation size for throughput goals")       \
453           range(0, 1)                                                       \
454                                                                             \
455   product(uintx, AdaptiveSizePolicyInitializingSteps, 20,                   \
456           "Number of steps where heuristics is used before data is used")   \
457           range(0, max_uintx)                                               \
458                                                                             \
459   develop(uintx, AdaptiveSizePolicyReadyThreshold, 5,                       \
460           "Number of collections before the adaptive sizing is started")    \
461                                                                             \
462   product(uintx, AdaptiveSizePolicyOutputInterval, 0,                       \
463           "Collection interval for printing information; zero means never") \
464           range(0, max_uintx)                                               \
465                                                                             \
466   product(bool, UseAdaptiveSizePolicyFootprintGoal, true,                   \
467           "Use adaptive minimum footprint as a goal")                       \
468                                                                             \
469   product(uintx, AdaptiveSizePolicyWeight, 10,                              \
470           "Weight given to exponential resizing, between 0 and 100")        \
471           range(0, 100)                                                     \
472                                                                             \
473   product(uintx, AdaptiveTimeWeight,       25,                              \
474           "Weight given to time in adaptive policy, between 0 and 100")     \
475           range(0, 100)                                                     \
476                                                                             \
477   product(uintx, PausePadding, 1,                                           \
478           "How much buffer to keep for pause time")                         \
479           range(0, max_juint)                                               \
480                                                                             \
481   product(uintx, PromotedPadding, 3,                                        \
482           "How much buffer to keep for promotion failure")                  \
483           range(0, max_juint)                                               \
484                                                                             \
485   product(uintx, SurvivorPadding, 3,                                        \
486           "How much buffer to keep for survivor overflow")                  \
487           range(0, max_juint)                                               \
488                                                                             \
489   product(uintx, ThresholdTolerance, 10,                                    \
490           "Allowed collection cost difference between generations")         \
491           range(0, 100)                                                     \
492                                                                             \
493   product(uintx, AdaptiveSizePolicyCollectionCostMargin, 50,                \
494           "If collection costs are within margin, reduce both by full "     \
495           "delta")                                                          \
496           range(0, 100)                                                     \
497                                                                             \
498   product(uintx, YoungGenerationSizeIncrement, 20,                          \
499           "Adaptive size percentage change in young generation")            \
500           range(0, 100)                                                     \
501                                                                             \
502   product(uintx, YoungGenerationSizeSupplement, 80,                         \
503           "Supplement to YoungedGenerationSizeIncrement used at startup")   \
504           range(0, 100)                                                     \
505                                                                             \
506   product(uintx, YoungGenerationSizeSupplementDecay, 8,                     \
507           "Decay factor to YoungedGenerationSizeSupplement")                \
508           range(1, max_uintx)                                               \
509                                                                             \
510   product(uintx, TenuredGenerationSizeIncrement, 20,                        \
511           "Adaptive size percentage change in tenured generation")          \
512           range(0, 100)                                                     \
513                                                                             \
514   product(uintx, TenuredGenerationSizeSupplement, 80,                       \
515           "Supplement to TenuredGenerationSizeIncrement used at startup")   \
516           range(0, 100)                                                     \
517                                                                             \
518   product(uintx, TenuredGenerationSizeSupplementDecay, 2,                   \
519           "Decay factor to TenuredGenerationSizeIncrement")                 \
520           range(1, max_uintx)                                               \
521                                                                             \
522   product(uintx, MaxGCPauseMillis, max_uintx - 1,                           \
523           "Adaptive size policy maximum GC pause time goal in millisecond, "\
524           "or (G1 Only) the maximum GC time per MMU time slice")            \
525           range(1, max_uintx - 1)                                           \
526           constraint(MaxGCPauseMillisConstraintFunc,AfterErgo)              \
527                                                                             \
528   product(uintx, GCPauseIntervalMillis, 0,                                  \
529           "Time slice for MMU specification")                               \
530           constraint(GCPauseIntervalMillisConstraintFunc,AfterErgo)         \
531                                                                             \
532   product(uintx, MaxGCMinorPauseMillis, max_uintx,                          \
533           "Adaptive size policy maximum GC minor pause time goal "          \
534           "in millisecond")                                                 \
535           range(0, max_uintx)                                               \
536                                                                             \
537   product(uintx, GCTimeRatio, 99,                                           \
538           "Adaptive size policy application time to GC time ratio")         \
539           range(0, max_juint)                                               \
540                                                                             \
541   product(uintx, AdaptiveSizeDecrementScaleFactor, 4,                       \
542           "Adaptive size scale down factor for shrinking")                  \
543           range(1, max_uintx)                                               \
544                                                                             \
545   product(bool, UseAdaptiveSizeDecayMajorGCCost, true,                      \
546           "Adaptive size decays the major cost for long major intervals")   \
547                                                                             \
548   product(uintx, AdaptiveSizeMajorGCDecayTimeScale, 10,                     \
549           "Time scale over which major costs decay")                        \
550           range(0, max_uintx)                                               \
551                                                                             \
552   product(uintx, MinSurvivorRatio, 3,                                       \
553           "Minimum ratio of young generation/survivor space size")          \
554           range(3, max_uintx)                                               \
555                                                                             \
556   product(uintx, InitialSurvivorRatio, 8,                                   \
557           "Initial ratio of young generation/survivor space size")          \
558           range(0, max_uintx)                                               \
559                                                                             \
560   product(size_t, BaseFootPrintEstimate, 256*M,                             \
561           "Estimate of footprint other than Java Heap")                     \
562           range(0, max_uintx)                                               \
563                                                                             \
564   product(bool, UseGCOverheadLimit, true,                                   \
565           "Use policy to limit of proportion of time spent in GC "          \
566           "before an OutOfMemory error is thrown")                          \
567                                                                             \
568   product(uintx, GCTimeLimit, 98,                                           \
569           "Limit of the proportion of time spent in GC before "             \
570           "an OutOfMemoryError is thrown (used with GCHeapFreeLimit)")      \
571           range(0, 100)                                                     \
572                                                                             \
573   product(uintx, GCHeapFreeLimit, 2,                                        \
574           "Minimum percentage of free space after a full GC before an "     \
575           "OutOfMemoryError is thrown (used with GCTimeLimit)")             \
576           range(0, 100)                                                     \
577                                                                             \
578   develop(uintx, GCOverheadLimitThreshold, 5,                               \
579           "Number of consecutive collections before gc time limit fires")   \
580           range(1, max_uintx)                                               \
581                                                                             \
582   product(intx, PrefetchCopyIntervalInBytes, -1,                            \
583           "How far ahead to prefetch destination area (<= 0 means off)")    \
584           range(-1, max_jint)                                               \
585                                                                             \
586   product(intx, PrefetchScanIntervalInBytes, -1,                            \
587           "How far ahead to prefetch scan area (<= 0 means off)")           \
588           range(-1, max_jint)                                               \
589                                                                             \
590   product(intx, PrefetchFieldsAhead, -1,                                    \
591           "How many fields ahead to prefetch in oop scan (<= 0 means off)") \
592           range(-1, max_jint)                                               \
593                                                                             \
594   diagnostic(bool, VerifyDuringStartup, false,                              \
595           "Verify memory system before executing any Java code "            \
596           "during VM initialization")                                       \
597                                                                             \
598   diagnostic(bool, VerifyBeforeExit, trueInDebug,                           \
599           "Verify system before exiting")                                   \
600                                                                             \
601   diagnostic(bool, VerifyBeforeGC, false,                                   \
602           "Verify memory system before GC")                                 \
603                                                                             \
604   diagnostic(bool, VerifyAfterGC, false,                                    \
605           "Verify memory system after GC")                                  \
606                                                                             \
607   diagnostic(bool, VerifyDuringGC, false,                                   \
608           "Verify memory system during GC (between phases)")                \
609                                                                             \
610   diagnostic(ccstrlist, VerifyGCType, "",                                   \
611              "GC type(s) to verify when Verify*GC is enabled."              \
612              "Available types are collector specific.")                     \
613                                                                             \
614   diagnostic(ccstrlist, VerifySubSet, "",                                   \
615           "Memory sub-systems to verify when Verify*GC flag(s) "            \
616           "are enabled. One or more sub-systems can be specified "          \
617           "in a comma separated string. Sub-systems are: "                  \
618           "threads, heap, symbol_table, string_table, codecache, "          \
619           "dictionary, classloader_data_graph, metaspace, jni_handles, "    \
620           "codecache_oops")                                                 \
621                                                                             \
622   diagnostic(bool, GCParallelVerificationEnabled, true,                     \
623           "Enable parallel memory system verification")                     \
624                                                                             \
625   diagnostic(bool, DeferInitialCardMark, false,                             \
626           "When +ReduceInitialCardMarks, explicitly defer any that "        \
627           "may arise from new_pre_store_barrier")                           \
628                                                                             \
629   product(bool, UseCondCardMark, false,                                     \
630           "Check for already marked card before updating card table")       \
631                                                                             \
632   diagnostic(bool, VerifyRememberedSets, false,                             \
633           "Verify GC remembered sets")                                      \
634                                                                             \
635   diagnostic(bool, VerifyObjectStartArray, true,                            \
636           "Verify GC object start array if verify before/after")            \
637                                                                             \
638   product(bool, DisableExplicitGC, false,                                   \
639           "Ignore calls to System.gc()")                                    \
640                                                                             \
641   product(bool, PrintGC, false,                                             \
642           "Print message at garbage collection. "                           \
643           "Deprecated, use -Xlog:gc instead.")                              \
644                                                                             \
645   product(bool, PrintGCDetails, false,                                      \
646           "Print more details at garbage collection. "                      \
647           "Deprecated, use -Xlog:gc* instead.")                             \
648                                                                             \
649   develop(intx, ConcGCYieldTimeout, 0,                                      \
650           "If non-zero, assert that GC threads yield within this "          \
651           "number of milliseconds")                                         \
652           range(0, max_intx)                                                \
653                                                                             \
654   notproduct(intx, ScavengeALotInterval,     1,                             \
655           "Interval between which scavenge will occur with +ScavengeALot")  \
656                                                                             \
657   notproduct(intx, FullGCALotInterval,     1,                               \
658           "Interval between which full gc will occur with +FullGCALot")     \
659                                                                             \
660   notproduct(intx, FullGCALotStart,     0,                                  \
661           "For which invocation to start FullGCAlot")                       \
662                                                                             \
663   notproduct(intx, FullGCALotDummies,  32*K,                                \
664           "Dummy object allocated with +FullGCALot, forcing all objects "   \
665           "to move")                                                        \
666                                                                             \
667   /* gc parameters */                                                       \
668   product(size_t, MinHeapSize, 0,                                           \
669           "Minimum heap size (in bytes); zero means use ergonomics")        \
670           constraint(MinHeapSizeConstraintFunc,AfterErgo)                   \
671                                                                             \
672   product(size_t, InitialHeapSize, 0,                                       \
673           "Initial heap size (in bytes); zero means use ergonomics")        \
674           constraint(InitialHeapSizeConstraintFunc,AfterErgo)               \
675                                                                             \
676   product(size_t, MaxHeapSize, ScaleForWordSize(96*M),                      \
677           "Maximum heap size (in bytes)")                                   \
678           constraint(MaxHeapSizeConstraintFunc,AfterErgo)                   \
679                                                                             \
680   manageable(size_t, SoftMaxHeapSize, 0,                                    \
681           "Soft limit for maximum heap size (in bytes)")                    \
682           constraint(SoftMaxHeapSizeConstraintFunc,AfterMemoryInit)         \
683                                                                             \
684   product(size_t, OldSize, ScaleForWordSize(4*M),                           \
685           "Initial tenured generation size (in bytes)")                     \
686           range(0, max_uintx)                                               \
687                                                                             \
688   product(size_t, NewSize, ScaleForWordSize(1*M),                           \
689           "Initial new generation size (in bytes)")                         \
690           constraint(NewSizeConstraintFunc,AfterErgo)                       \
691                                                                             \
692   product(size_t, MaxNewSize, max_uintx,                                    \
693           "Maximum new generation size (in bytes), max_uintx means set "    \
694           "ergonomically")                                                  \
695           range(0, max_uintx)                                               \
696                                                                             \
697   product_pd(size_t, HeapBaseMinAddress,                                    \
698           "OS specific low limit for heap base address")                    \
699           constraint(HeapBaseMinAddressConstraintFunc,AfterErgo)            \
700                                                                             \
701   product(size_t, PretenureSizeThreshold, 0,                                \
702           "Maximum size in bytes of objects allocated in DefNew "           \
703           "generation; zero means no maximum")                              \
704           range(0, max_uintx)                                               \
705                                                                             \
706   product(size_t, MinTLABSize, 2*K,                                         \
707           "Minimum allowed TLAB size (in bytes)")                           \
708           range(1, max_uintx/2)                                             \
709           constraint(MinTLABSizeConstraintFunc,AfterMemoryInit)             \
710                                                                             \
711   product(size_t, TLABSize, 0,                                              \
712           "Starting TLAB size (in bytes); zero means set ergonomically")    \
713           constraint(TLABSizeConstraintFunc,AfterMemoryInit)                \
714                                                                             \
715   product(size_t, YoungPLABSize, 4096,                                      \
716           "Size of young gen promotion LAB's (in HeapWords)")               \
717           constraint(YoungPLABSizeConstraintFunc,AfterMemoryInit)           \
718                                                                             \
719   product(size_t, OldPLABSize, 1024,                                        \
720           "Size of old gen promotion LAB's (in HeapWords)")                 \
721           constraint(OldPLABSizeConstraintFunc,AfterMemoryInit)             \
722                                                                             \
723   product(uintx, TLABAllocationWeight, 35,                                  \
724           "Allocation averaging weight")                                    \
725           range(0, 100)                                                     \
726                                                                             \
727   /* Limit the lower bound of this flag to 1 as it is used  */              \
728   /* in a division expression.                              */              \
729   product(uintx, TLABWasteTargetPercent, 1,                                 \
730           "Percentage of Eden that can be wasted")                          \
731           range(1, 100)                                                     \
732                                                                             \
733   product(uintx, TLABRefillWasteFraction,    64,                            \
734           "Maximum TLAB waste at a refill (internal fragmentation)")        \
735           range(1, max_juint)                                               \
736                                                                             \
737   product(uintx, TLABWasteIncrement,    4,                                  \
738           "Increment allowed waste at slow allocation")                     \
739           range(0, max_jint)                                                \
740           constraint(TLABWasteIncrementConstraintFunc,AfterMemoryInit)      \
741                                                                             \
742   product(uintx, SurvivorRatio, 8,                                          \
743           "Ratio of eden/survivor space size")                              \
744           range(1, max_uintx-2)                                             \
745           constraint(SurvivorRatioConstraintFunc,AfterMemoryInit)           \
746                                                                             \
747   product(uintx, NewRatio, 2,                                               \
748           "Ratio of old/new generation sizes")                              \
749           range(0, max_uintx-1)                                             \
750                                                                             \
751   product_pd(size_t, NewSizeThreadIncrease,                                 \
752           "Additional size added to desired new generation size per "       \
753           "non-daemon thread (in bytes)")                                   \
754           range(0, max_uintx)                                               \
755                                                                             \
756   product(uintx, QueuedAllocationWarningCount, 0,                           \
757           "Number of times an allocation that queues behind a GC "          \
758           "will retry before printing a warning")                           \
759           range(0, max_uintx)                                               \
760                                                                             \
761   diagnostic(uintx, VerifyGCStartAt,   0,                                   \
762           "GC invoke count where +VerifyBefore/AfterGC kicks in")           \
763           range(0, max_uintx)                                               \
764                                                                             \
765   diagnostic(intx, VerifyGCLevel,     0,                                    \
766           "Generation level at which to start +VerifyBefore/AfterGC")       \
767           range(0, 1)                                                       \
768                                                                             \
769   product(uintx, MaxTenuringThreshold,    15,                               \
770           "Maximum value for tenuring threshold")                           \
771           range(0, markWord::max_age + 1)                                   \
772           constraint(MaxTenuringThresholdConstraintFunc,AfterErgo)          \
773                                                                             \
774   product(uintx, InitialTenuringThreshold,    7,                            \
775           "Initial value for tenuring threshold")                           \
776           range(0, markWord::max_age + 1)                                   \
777           constraint(InitialTenuringThresholdConstraintFunc,AfterErgo)      \
778                                                                             \
779   product(uintx, TargetSurvivorRatio,    50,                                \
780           "Desired percentage of survivor space used after scavenge")       \
781           range(0, 100)                                                     \
782                                                                             \
783   product(uintx, MarkSweepDeadRatio,     5,                                 \
784           "Percentage (0-100) of the old gen allowed as dead wood. "        \
785           "Serial mark sweep treats this as both the minimum and maximum "  \
786           "value. "                                                         \
787           "Par compact uses a variable scale based on the density of the "  \
788           "generation and treats this as the maximum value when the heap "  \
789           "is either completely full or completely empty.  Par compact "    \
790           "also has a smaller default value; see arguments.cpp.")           \
791           range(0, 100)                                                     \
792                                                                             \
793   product(uint, MarkSweepAlwaysCompactCount,     4,                         \
794           "How often should we fully compact the heap (ignoring the dead "  \
795           "space parameters)")                                              \
796           range(1, max_juint)                                               \
797                                                                             \
798   develop(uintx, GCExpandToAllocateDelayMillis, 0,                          \
799           "Delay between expansion and allocation (in milliseconds)")       \
800                                                                             \
801   product(uintx, GCDrainStackTargetSize, 64,                                \
802           "Number of entries we will try to leave on the stack "            \
803           "during parallel gc")                                             \
804           range(0, max_juint)
805 
806 #endif // SHARE_GC_SHARED_GC_GLOBALS_HPP