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