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