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