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