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