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