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 #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   SERIALGC_ONLY(GC_SERIAL_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   SHENANDOAHGC_ONLY(GC_SHENANDOAH_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, UseParallelGC, false,                                       \
 190           "Use the Parallel Scavenge garbage collector")                    \
 191                                                                             \
 192   product(bool, UseParallelOldGC, false,                                    \
 193           "Use the Parallel Old garbage collector")                         \
 194                                                                             \
 195   experimental(bool, UseEpsilonGC, false,                                   \
 196           "Use the Epsilon (no-op) garbage collector")                      \
 197                                                                             \
 198   experimental(bool, UseZGC, false,                                         \
 199           "Use the Z garbage collector")                                    \
 200                                                                             \
 201   product(bool, UseShenandoahGC, false,                                     \
 202           "Use the Shenandoah 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   experimental(size_t, ReferencesPerThread, 1000,                           \
 333                "Ergonomically start one thread for this amount of "         \
 334                "references for reference processing if "                    \
 335                "ParallelRefProcEnabled is true. Specify 0 to disable and "  \
 336                "use all threads.")                                          \
 337                                                                             \
 338   product(uintx, InitiatingHeapOccupancyPercent, 45,                        \
 339           "The percent occupancy (IHOP) of the current old generation "     \
 340           "capacity above which a concurrent mark cycle will be initiated " \
 341           "Its value may change over time if adaptive IHOP is enabled, "    \
 342           "otherwise the value remains constant. "                          \
 343           "In the latter case a value of 0 will result as frequent as "     \
 344           "possible concurrent marking cycles. A value of 100 disables "    \
 345           "concurrent marking. "                                            \
 346           "Fragmentation waste in the old generation is not considered "    \
 347           "free space in this calculation. (G1 collector only)")            \
 348           range(0, 100)                                                     \
 349                                                                             \
 350   notproduct(bool, ScavengeALot, false,                                     \
 351           "Force scavenge at every Nth exit from the runtime system "       \
 352           "(N=ScavengeALotInterval)")                                       \
 353                                                                             \
 354   develop(bool, FullGCALot, false,                                          \
 355           "Force full gc at every Nth exit from the runtime system "        \
 356           "(N=FullGCALotInterval)")                                         \
 357                                                                             \
 358   notproduct(bool, GCALotAtAllSafepoints, false,                            \
 359           "Enforce ScavengeALot/GCALot at all potential safepoints")        \
 360                                                                             \
 361   notproduct(bool, PromotionFailureALot, false,                             \
 362           "Use promotion failure handling on every youngest generation "    \
 363           "collection")                                                     \
 364                                                                             \
 365   develop(uintx, PromotionFailureALotCount, 1000,                           \
 366           "Number of promotion failures occurring at PLAB "                 \
 367           "refill attempts (ParNew) or promotion attempts "                 \
 368           "(other young collectors)")                                       \
 369                                                                             \
 370   develop(uintx, PromotionFailureALotInterval, 5,                           \
 371           "Total collections between promotion failures a lot")             \
 372                                                                             \
 373   experimental(uintx, WorkStealingSleepMillis, 1,                           \
 374           "Sleep time when sleep is used for yields")                       \
 375                                                                             \
 376   experimental(uintx, WorkStealingYieldsBeforeSleep, 5000,                  \
 377           "Number of yields before a sleep is done during work stealing")   \
 378                                                                             \
 379   experimental(uintx, WorkStealingHardSpins, 4096,                          \
 380           "Number of iterations in a spin loop between checks on "          \
 381           "time out of hard spin")                                          \
 382                                                                             \
 383   experimental(uintx, WorkStealingSpinToYieldRatio, 10,                     \
 384           "Ratio of hard spins to calls to yield")                          \
 385                                                                             \
 386   develop(uintx, ObjArrayMarkingStride, 2048,                               \
 387           "Number of object array elements to push onto the marking stack " \
 388           "before pushing a continuation entry")                            \
 389                                                                             \
 390   develop(bool, MetadataAllocationFailALot, false,                          \
 391           "Fail metadata allocations at intervals controlled by "           \
 392           "MetadataAllocationFailALotInterval")                             \
 393                                                                             \
 394   develop(uintx, MetadataAllocationFailALotInterval, 1000,                  \
 395           "Metadata allocation failure a lot interval")                     \
 396                                                                             \
 397   notproduct(bool, ExecuteInternalVMTests, false,                           \
 398           "Enable execution of internal VM tests")                          \
 399                                                                             \
 400   notproduct(bool, VerboseInternalVMTests, false,                           \
 401           "Turn on logging for internal VM tests.")                         \
 402                                                                             \
 403   product(bool, ExecutingUnitTests, false,                                  \
 404           "Whether the JVM is running unit tests or not")                   \
 405                                                                             \
 406   product_pd(bool, UseTLAB, "Use thread-local object allocation")           \
 407                                                                             \
 408   product_pd(bool, ResizeTLAB,                                              \
 409           "Dynamically resize TLAB size for threads")                       \
 410                                                                             \
 411   product(bool, ZeroTLAB, false,                                            \
 412           "Zero out the newly created TLAB")                                \
 413                                                                             \
 414   product(bool, TLABStats, true,                                            \
 415           "Provide more detailed and expensive TLAB statistics.")           \
 416                                                                             \
 417   product_pd(bool, NeverActAsServerClassMachine,                            \
 418           "Never act like a server-class machine")                          \
 419                                                                             \
 420   product(bool, AlwaysActAsServerClassMachine, false,                       \
 421           "Always act like a server-class machine")                         \
 422                                                                             \
 423   product_pd(uint64_t, MaxRAM,                                              \
 424           "Real memory size (in bytes) used to set maximum heap size")      \
 425           range(0, 0XFFFFFFFFFFFFFFFF)                                      \
 426                                                                             \
 427   product(bool, AggressiveHeap, false,                                      \
 428           "Optimize heap options for long-running memory intensive apps")   \
 429                                                                             \
 430   product(size_t, ErgoHeapSizeLimit, 0,                                     \
 431           "Maximum ergonomically set heap size (in bytes); zero means use " \
 432           "MaxRAM * MaxRAMPercentage / 100")                                \
 433           range(0, max_uintx)                                               \
 434                                                                             \
 435   product(uintx, MaxRAMFraction, 4,                                         \
 436           "Maximum fraction (1/n) of real memory used for maximum heap "    \
 437           "size. "                                                          \
 438           "Deprecated, use MaxRAMPercentage instead")                       \
 439           range(1, max_uintx)                                               \
 440                                                                             \
 441   product(uintx, MinRAMFraction, 2,                                         \
 442           "Minimum fraction (1/n) of real memory used for maximum heap "    \
 443           "size on systems with small physical memory size. "               \
 444           "Deprecated, use MinRAMPercentage instead")                       \
 445           range(1, max_uintx)                                               \
 446                                                                             \
 447   product(uintx, InitialRAMFraction, 64,                                    \
 448           "Fraction (1/n) of real memory used for initial heap size. "      \
 449           "Deprecated, use InitialRAMPercentage instead")                   \
 450           range(1, max_uintx)                                               \
 451                                                                             \
 452   product(double, MaxRAMPercentage, 25.0,                                   \
 453           "Maximum percentage of real memory used for maximum heap size")   \
 454           range(0.0, 100.0)                                                 \
 455                                                                             \
 456   product(double, MinRAMPercentage, 50.0,                                   \
 457           "Minimum percentage of real memory used for maximum heap"         \
 458           "size on systems with small physical memory size")                \
 459           range(0.0, 100.0)                                                 \
 460                                                                             \
 461   product(double, InitialRAMPercentage, 1.5625,                             \
 462           "Percentage of real memory used for initial heap size")           \
 463           range(0.0, 100.0)                                                 \
 464                                                                             \
 465   product(int, ActiveProcessorCount, -1,                                    \
 466           "Specify the CPU count the VM should use and report as active")   \
 467                                                                             \
 468   develop(uintx, MaxVirtMemFraction, 2,                                     \
 469           "Maximum fraction (1/n) of virtual memory used for ergonomically "\
 470           "determining maximum heap size")                                  \
 471                                                                             \
 472   product(bool, UseAdaptiveSizePolicy, true,                                \
 473           "Use adaptive generation sizing policies")                        \
 474                                                                             \
 475   product(bool, UsePSAdaptiveSurvivorSizePolicy, true,                      \
 476           "Use adaptive survivor sizing policies")                          \
 477                                                                             \
 478   product(bool, UseAdaptiveGenerationSizePolicyAtMinorCollection, true,     \
 479           "Use adaptive young-old sizing policies at minor collections")    \
 480                                                                             \
 481   product(bool, UseAdaptiveGenerationSizePolicyAtMajorCollection, true,     \
 482           "Use adaptive young-old sizing policies at major collections")    \
 483                                                                             \
 484   product(bool, UseAdaptiveSizePolicyWithSystemGC, false,                   \
 485           "Include statistics from System.gc() for adaptive size policy")   \
 486                                                                             \
 487   product(bool, UseAdaptiveGCBoundary, false,                               \
 488           "Allow young-old boundary to move")                               \
 489                                                                             \
 490   develop(intx, PSAdaptiveSizePolicyResizeVirtualSpaceAlot, -1,             \
 491           "Resize the virtual spaces of the young or old generations")      \
 492           range(-1, 1)                                                      \
 493                                                                             \
 494   product(uintx, AdaptiveSizeThroughPutPolicy, 0,                           \
 495           "Policy for changing generation size for throughput goals")       \
 496           range(0, 1)                                                       \
 497                                                                             \
 498   product(uintx, AdaptiveSizePolicyInitializingSteps, 20,                   \
 499           "Number of steps where heuristics is used before data is used")   \
 500           range(0, max_uintx)                                               \
 501                                                                             \
 502   develop(uintx, AdaptiveSizePolicyReadyThreshold, 5,                       \
 503           "Number of collections before the adaptive sizing is started")    \
 504                                                                             \
 505   product(uintx, AdaptiveSizePolicyOutputInterval, 0,                       \
 506           "Collection interval for printing information; zero means never") \
 507           range(0, max_uintx)                                               \
 508                                                                             \
 509   product(bool, UseAdaptiveSizePolicyFootprintGoal, true,                   \
 510           "Use adaptive minimum footprint as a goal")                       \
 511                                                                             \
 512   product(uintx, AdaptiveSizePolicyWeight, 10,                              \
 513           "Weight given to exponential resizing, between 0 and 100")        \
 514           range(0, 100)                                                     \
 515                                                                             \
 516   product(uintx, AdaptiveTimeWeight,       25,                              \
 517           "Weight given to time in adaptive policy, between 0 and 100")     \
 518           range(0, 100)                                                     \
 519                                                                             \
 520   product(uintx, PausePadding, 1,                                           \
 521           "How much buffer to keep for pause time")                         \
 522           range(0, max_juint)                                               \
 523                                                                             \
 524   product(uintx, PromotedPadding, 3,                                        \
 525           "How much buffer to keep for promotion failure")                  \
 526           range(0, max_juint)                                               \
 527                                                                             \
 528   product(uintx, SurvivorPadding, 3,                                        \
 529           "How much buffer to keep for survivor overflow")                  \
 530           range(0, max_juint)                                               \
 531                                                                             \
 532   product(uintx, ThresholdTolerance, 10,                                    \
 533           "Allowed collection cost difference between generations")         \
 534           range(0, 100)                                                     \
 535                                                                             \
 536   product(uintx, AdaptiveSizePolicyCollectionCostMargin, 50,                \
 537           "If collection costs are within margin, reduce both by full "     \
 538           "delta")                                                          \
 539           range(0, 100)                                                     \
 540                                                                             \
 541   product(uintx, YoungGenerationSizeIncrement, 20,                          \
 542           "Adaptive size percentage change in young generation")            \
 543           range(0, 100)                                                     \
 544                                                                             \
 545   product(uintx, YoungGenerationSizeSupplement, 80,                         \
 546           "Supplement to YoungedGenerationSizeIncrement used at startup")   \
 547           range(0, 100)                                                     \
 548                                                                             \
 549   product(uintx, YoungGenerationSizeSupplementDecay, 8,                     \
 550           "Decay factor to YoungedGenerationSizeSupplement")                \
 551           range(1, max_uintx)                                               \
 552                                                                             \
 553   product(uintx, TenuredGenerationSizeIncrement, 20,                        \
 554           "Adaptive size percentage change in tenured generation")          \
 555           range(0, 100)                                                     \
 556                                                                             \
 557   product(uintx, TenuredGenerationSizeSupplement, 80,                       \
 558           "Supplement to TenuredGenerationSizeIncrement used at startup")   \
 559           range(0, 100)                                                     \
 560                                                                             \
 561   product(uintx, TenuredGenerationSizeSupplementDecay, 2,                   \
 562           "Decay factor to TenuredGenerationSizeIncrement")                 \
 563           range(1, max_uintx)                                               \
 564                                                                             \
 565   product(uintx, MaxGCPauseMillis, max_uintx - 1,                           \
 566           "Adaptive size policy maximum GC pause time goal in millisecond, "\
 567           "or (G1 Only) the maximum GC time per MMU time slice")            \
 568           range(1, max_uintx - 1)                                           \
 569           constraint(MaxGCPauseMillisConstraintFunc,AfterErgo)              \
 570                                                                             \
 571   product(uintx, GCPauseIntervalMillis, 0,                                  \
 572           "Time slice for MMU specification")                               \
 573           constraint(GCPauseIntervalMillisConstraintFunc,AfterErgo)         \
 574                                                                             \
 575   product(uintx, MaxGCMinorPauseMillis, max_uintx,                          \
 576           "Adaptive size policy maximum GC minor pause time goal "          \
 577           "in millisecond")                                                 \
 578           range(0, max_uintx)                                               \
 579                                                                             \
 580   product(uintx, GCTimeRatio, 99,                                           \
 581           "Adaptive size policy application time to GC time ratio")         \
 582           range(0, max_juint)                                               \
 583                                                                             \
 584   product(uintx, AdaptiveSizeDecrementScaleFactor, 4,                       \
 585           "Adaptive size scale down factor for shrinking")                  \
 586           range(1, max_uintx)                                               \
 587                                                                             \
 588   product(bool, UseAdaptiveSizeDecayMajorGCCost, true,                      \
 589           "Adaptive size decays the major cost for long major intervals")   \
 590                                                                             \
 591   product(uintx, AdaptiveSizeMajorGCDecayTimeScale, 10,                     \
 592           "Time scale over which major costs decay")                        \
 593           range(0, max_uintx)                                               \
 594                                                                             \
 595   product(uintx, MinSurvivorRatio, 3,                                       \
 596           "Minimum ratio of young generation/survivor space size")          \
 597           range(3, max_uintx)                                               \
 598                                                                             \
 599   product(uintx, InitialSurvivorRatio, 8,                                   \
 600           "Initial ratio of young generation/survivor space size")          \
 601           range(0, max_uintx)                                               \
 602                                                                             \
 603   product(size_t, BaseFootPrintEstimate, 256*M,                             \
 604           "Estimate of footprint other than Java Heap")                     \
 605           range(0, max_uintx)                                               \
 606                                                                             \
 607   product(bool, UseGCOverheadLimit, true,                                   \
 608           "Use policy to limit of proportion of time spent in GC "          \
 609           "before an OutOfMemory error is thrown")                          \
 610                                                                             \
 611   product(uintx, GCTimeLimit, 98,                                           \
 612           "Limit of the proportion of time spent in GC before "             \
 613           "an OutOfMemoryError is thrown (used with GCHeapFreeLimit)")      \
 614           range(0, 100)                                                     \
 615                                                                             \
 616   product(uintx, GCHeapFreeLimit, 2,                                        \
 617           "Minimum percentage of free space after a full GC before an "     \
 618           "OutOfMemoryError is thrown (used with GCTimeLimit)")             \
 619           range(0, 100)                                                     \
 620                                                                             \
 621   develop(uintx, AdaptiveSizePolicyGCTimeLimitThreshold, 5,                 \
 622           "Number of consecutive collections before gc time limit fires")   \
 623           range(1, max_uintx)                                               \
 624                                                                             \
 625   product(intx, PrefetchCopyIntervalInBytes, -1,                            \
 626           "How far ahead to prefetch destination area (<= 0 means off)")    \
 627           range(-1, max_jint)                                               \
 628                                                                             \
 629   product(intx, PrefetchScanIntervalInBytes, -1,                            \
 630           "How far ahead to prefetch scan area (<= 0 means off)")           \
 631           range(-1, max_jint)                                               \
 632                                                                             \
 633   product(intx, PrefetchFieldsAhead, -1,                                    \
 634           "How many fields ahead to prefetch in oop scan (<= 0 means off)") \
 635           range(-1, max_jint)                                               \
 636                                                                             \
 637   diagnostic(bool, VerifyDuringStartup, false,                              \
 638           "Verify memory system before executing any Java code "            \
 639           "during VM initialization")                                       \
 640                                                                             \
 641   diagnostic(bool, VerifyBeforeExit, trueInDebug,                           \
 642           "Verify system before exiting")                                   \
 643                                                                             \
 644   diagnostic(bool, VerifyBeforeGC, false,                                   \
 645           "Verify memory system before GC")                                 \
 646                                                                             \
 647   diagnostic(bool, VerifyAfterGC, false,                                    \
 648           "Verify memory system after GC")                                  \
 649                                                                             \
 650   diagnostic(bool, VerifyDuringGC, false,                                   \
 651           "Verify memory system during GC (between phases)")                \
 652                                                                             \
 653   diagnostic(ccstrlist, VerifyGCType, "",                                   \
 654              "GC type(s) to verify when Verify*GC is enabled."              \
 655              "Available types are collector specific.")                     \
 656                                                                             \
 657   diagnostic(ccstrlist, VerifySubSet, "",                                   \
 658           "Memory sub-systems to verify when Verify*GC flag(s) "            \
 659           "are enabled. One or more sub-systems can be specified "          \
 660           "in a comma separated string. Sub-systems are: "                  \
 661           "threads, heap, symbol_table, string_table, codecache, "          \
 662           "dictionary, classloader_data_graph, metaspace, jni_handles, "    \
 663           "codecache_oops")                                                 \
 664                                                                             \
 665   diagnostic(bool, GCParallelVerificationEnabled, true,                     \
 666           "Enable parallel memory system verification")                     \
 667                                                                             \
 668   diagnostic(bool, DeferInitialCardMark, false,                             \
 669           "When +ReduceInitialCardMarks, explicitly defer any that "        \
 670           "may arise from new_pre_store_barrier")                           \
 671                                                                             \
 672   product(bool, UseCondCardMark, false,                                     \
 673           "Check for already marked card before updating card table")       \
 674                                                                             \
 675   diagnostic(bool, VerifyRememberedSets, false,                             \
 676           "Verify GC remembered sets")                                      \
 677                                                                             \
 678   diagnostic(bool, VerifyObjectStartArray, true,                            \
 679           "Verify GC object start array if verify before/after")            \
 680                                                                             \
 681   product(bool, DisableExplicitGC, false,                                   \
 682           "Ignore calls to System.gc()")                                    \
 683                                                                             \
 684   product(bool, BindGCTaskThreadsToCPUs, false,                             \
 685           "Bind GCTaskThreads to CPUs if possible")                         \
 686                                                                             \
 687   product(bool, UseGCTaskAffinity, false,                                   \
 688           "Use worker affinity when asking for GCTasks")                    \
 689                                                                             \
 690   product(bool, PrintGC, false,                                             \
 691           "Print message at garbage collection. "                           \
 692           "Deprecated, use -Xlog:gc instead.")                              \
 693                                                                             \
 694   product(bool, PrintGCDetails, false,                                      \
 695           "Print more details at garbage collection. "                      \
 696           "Deprecated, use -Xlog:gc* instead.")                             \
 697                                                                             \
 698   develop(intx, ConcGCYieldTimeout, 0,                                      \
 699           "If non-zero, assert that GC threads yield within this "          \
 700           "number of milliseconds")                                         \
 701           range(0, max_intx)                                                \
 702                                                                             \
 703   notproduct(intx, ScavengeALotInterval,     1,                             \
 704           "Interval between which scavenge will occur with +ScavengeALot")  \
 705                                                                             \
 706   notproduct(intx, FullGCALotInterval,     1,                               \
 707           "Interval between which full gc will occur with +FullGCALot")     \
 708                                                                             \
 709   notproduct(intx, FullGCALotStart,     0,                                  \
 710           "For which invocation to start FullGCAlot")                       \
 711                                                                             \
 712   notproduct(intx, FullGCALotDummies,  32*K,                                \
 713           "Dummy object allocated with +FullGCALot, forcing all objects "   \
 714           "to move")                                                        \
 715                                                                             \
 716   /* gc parameters */                                                       \
 717   product(size_t, InitialHeapSize, 0,                                       \
 718           "Initial heap size (in bytes); zero means use ergonomics")        \
 719           constraint(InitialHeapSizeConstraintFunc,AfterErgo)               \
 720                                                                             \
 721   product(size_t, MaxHeapSize, ScaleForWordSize(96*M),                      \
 722           "Maximum heap size (in bytes)")                                   \
 723           constraint(MaxHeapSizeConstraintFunc,AfterErgo)                   \
 724                                                                             \
 725   product(size_t, OldSize, ScaleForWordSize(4*M),                           \
 726           "Initial tenured generation size (in bytes)")                     \
 727           range(0, max_uintx)                                               \
 728                                                                             \
 729   product(size_t, NewSize, ScaleForWordSize(1*M),                           \
 730           "Initial new generation size (in bytes)")                         \
 731           constraint(NewSizeConstraintFunc,AfterErgo)                       \
 732                                                                             \
 733   product(size_t, MaxNewSize, max_uintx,                                    \
 734           "Maximum new generation size (in bytes), max_uintx means set "    \
 735           "ergonomically")                                                  \
 736           range(0, max_uintx)                                               \
 737                                                                             \
 738   product_pd(size_t, HeapBaseMinAddress,                                    \
 739           "OS specific low limit for heap base address")                    \
 740           constraint(HeapBaseMinAddressConstraintFunc,AfterErgo)            \
 741                                                                             \
 742   product(size_t, PretenureSizeThreshold, 0,                                \
 743           "Maximum size in bytes of objects allocated in DefNew "           \
 744           "generation; zero means no maximum")                              \
 745           range(0, max_uintx)                                               \
 746                                                                             \
 747   product(size_t, MinTLABSize, 2*K,                                         \
 748           "Minimum allowed TLAB size (in bytes)")                           \
 749           range(1, max_uintx/2)                                             \
 750           constraint(MinTLABSizeConstraintFunc,AfterMemoryInit)             \
 751                                                                             \
 752   product(size_t, TLABSize, 0,                                              \
 753           "Starting TLAB size (in bytes); zero means set ergonomically")    \
 754           constraint(TLABSizeConstraintFunc,AfterMemoryInit)                \
 755                                                                             \
 756   product(size_t, YoungPLABSize, 4096,                                      \
 757           "Size of young gen promotion LAB's (in HeapWords)")               \
 758           constraint(YoungPLABSizeConstraintFunc,AfterMemoryInit)           \
 759                                                                             \
 760   product(size_t, OldPLABSize, 1024,                                        \
 761           "Size of old gen promotion LAB's (in HeapWords), or Number "      \
 762           "of blocks to attempt to claim when refilling CMS LAB's")         \
 763           constraint(OldPLABSizeConstraintFunc,AfterMemoryInit)             \
 764                                                                             \
 765   product(uintx, TLABAllocationWeight, 35,                                  \
 766           "Allocation averaging weight")                                    \
 767           range(0, 100)                                                     \
 768                                                                             \
 769   /* Limit the lower bound of this flag to 1 as it is used  */              \
 770   /* in a division expression.                              */              \
 771   product(uintx, TLABWasteTargetPercent, 1,                                 \
 772           "Percentage of Eden that can be wasted")                          \
 773           range(1, 100)                                                     \
 774                                                                             \
 775   product(uintx, TLABRefillWasteFraction,    64,                            \
 776           "Maximum TLAB waste at a refill (internal fragmentation)")        \
 777           range(1, max_juint)                                               \
 778                                                                             \
 779   product(uintx, TLABWasteIncrement,    4,                                  \
 780           "Increment allowed waste at slow allocation")                     \
 781           range(0, max_jint)                                                \
 782           constraint(TLABWasteIncrementConstraintFunc,AfterMemoryInit)      \
 783                                                                             \
 784   product(uintx, SurvivorRatio, 8,                                          \
 785           "Ratio of eden/survivor space size")                              \
 786           range(1, max_uintx-2)                                             \
 787           constraint(SurvivorRatioConstraintFunc,AfterMemoryInit)           \
 788                                                                             \
 789   product(uintx, NewRatio, 2,                                               \
 790           "Ratio of old/new generation sizes")                              \
 791           range(0, max_uintx-1)                                             \
 792                                                                             \
 793   product_pd(size_t, NewSizeThreadIncrease,                                 \
 794           "Additional size added to desired new generation size per "       \
 795           "non-daemon thread (in bytes)")                                   \
 796           range(0, max_uintx)                                               \
 797                                                                             \
 798   product(uintx, QueuedAllocationWarningCount, 0,                           \
 799           "Number of times an allocation that queues behind a GC "          \
 800           "will retry before printing a warning")                           \
 801           range(0, max_uintx)                                               \
 802                                                                             \
 803   diagnostic(uintx, VerifyGCStartAt,   0,                                   \
 804           "GC invoke count where +VerifyBefore/AfterGC kicks in")           \
 805           range(0, max_uintx)                                               \
 806                                                                             \
 807   diagnostic(intx, VerifyGCLevel,     0,                                    \
 808           "Generation level at which to start +VerifyBefore/AfterGC")       \
 809           range(0, 1)                                                       \
 810                                                                             \
 811   product(uintx, MaxTenuringThreshold,    15,                               \
 812           "Maximum value for tenuring threshold")                           \
 813           range(0, markOopDesc::max_age + 1)                                \
 814           constraint(MaxTenuringThresholdConstraintFunc,AfterErgo)          \
 815                                                                             \
 816   product(uintx, InitialTenuringThreshold,    7,                            \
 817           "Initial value for tenuring threshold")                           \
 818           range(0, markOopDesc::max_age + 1)                                \
 819           constraint(InitialTenuringThresholdConstraintFunc,AfterErgo)      \
 820                                                                             \
 821   product(uintx, TargetSurvivorRatio,    50,                                \
 822           "Desired percentage of survivor space used after scavenge")       \
 823           range(0, 100)                                                     \
 824                                                                             \
 825   product(uintx, MarkSweepDeadRatio,     5,                                 \
 826           "Percentage (0-100) of the old gen allowed as dead wood. "        \
 827           "Serial mark sweep treats this as both the minimum and maximum "  \
 828           "value. "                                                         \
 829           "CMS uses this value only if it falls back to mark sweep. "       \
 830           "Par compact uses a variable scale based on the density of the "  \
 831           "generation and treats this as the maximum value when the heap "  \
 832           "is either completely full or completely empty.  Par compact "    \
 833           "also has a smaller default value; see arguments.cpp.")           \
 834           range(0, 100)                                                     \
 835                                                                             \
 836   product(uint, MarkSweepAlwaysCompactCount,     4,                         \
 837           "How often should we fully compact the heap (ignoring the dead "  \
 838           "space parameters)")                                              \
 839           range(1, max_juint)                                               \
 840                                                                             \
 841   develop(uintx, GCExpandToAllocateDelayMillis, 0,                          \
 842           "Delay between expansion and allocation (in milliseconds)")       \
 843                                                                             \
 844   product(uintx, GCDrainStackTargetSize, 64,                                \
 845           "Number of entries we will try to leave on the stack "            \
 846           "during parallel gc")                                             \
 847           range(0, max_juint)
 848 
 849 #endif // SHARE_GC_SHARED_GC_GLOBALS_HPP