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