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   experimental(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   product(bool, UseAdaptiveGCBoundary, false,                               \
 424           "Allow young-old boundary to move")                               \
 425                                                                             \
 426   develop(intx, PSAdaptiveSizePolicyResizeVirtualSpaceAlot, -1,             \
 427           "Resize the virtual spaces of the young or old generations")      \
 428           range(-1, 1)                                                      \
 429                                                                             \
 430   product(uintx, AdaptiveSizeThroughPutPolicy, 0,                           \
 431           "Policy for changing generation size for throughput goals")       \
 432           range(0, 1)                                                       \
 433                                                                             \
 434   product(uintx, AdaptiveSizePolicyInitializingSteps, 20,                   \
 435           "Number of steps where heuristics is used before data is used")   \
 436           range(0, max_uintx)                                               \
 437                                                                             \
 438   develop(uintx, AdaptiveSizePolicyReadyThreshold, 5,                       \
 439           "Number of collections before the adaptive sizing is started")    \
 440                                                                             \
 441   product(uintx, AdaptiveSizePolicyOutputInterval, 0,                       \
 442           "Collection interval for printing information; zero means never") \
 443           range(0, max_uintx)                                               \
 444                                                                             \
 445   product(bool, UseAdaptiveSizePolicyFootprintGoal, true,                   \
 446           "Use adaptive minimum footprint as a goal")                       \
 447                                                                             \
 448   product(uintx, AdaptiveSizePolicyWeight, 10,                              \
 449           "Weight given to exponential resizing, between 0 and 100")        \
 450           range(0, 100)                                                     \
 451                                                                             \
 452   product(uintx, AdaptiveTimeWeight,       25,                              \
 453           "Weight given to time in adaptive policy, between 0 and 100")     \
 454           range(0, 100)                                                     \
 455                                                                             \
 456   product(uintx, PausePadding, 1,                                           \
 457           "How much buffer to keep for pause time")                         \
 458           range(0, max_juint)                                               \
 459                                                                             \
 460   product(uintx, PromotedPadding, 3,                                        \
 461           "How much buffer to keep for promotion failure")                  \
 462           range(0, max_juint)                                               \
 463                                                                             \
 464   product(uintx, SurvivorPadding, 3,                                        \
 465           "How much buffer to keep for survivor overflow")                  \
 466           range(0, max_juint)                                               \
 467                                                                             \
 468   product(uintx, ThresholdTolerance, 10,                                    \
 469           "Allowed collection cost difference between generations")         \
 470           range(0, 100)                                                     \
 471                                                                             \
 472   product(uintx, AdaptiveSizePolicyCollectionCostMargin, 50,                \
 473           "If collection costs are within margin, reduce both by full "     \
 474           "delta")                                                          \
 475           range(0, 100)                                                     \
 476                                                                             \
 477   product(uintx, YoungGenerationSizeIncrement, 20,                          \
 478           "Adaptive size percentage change in young generation")            \
 479           range(0, 100)                                                     \
 480                                                                             \
 481   product(uintx, YoungGenerationSizeSupplement, 80,                         \
 482           "Supplement to YoungedGenerationSizeIncrement used at startup")   \
 483           range(0, 100)                                                     \
 484                                                                             \
 485   product(uintx, YoungGenerationSizeSupplementDecay, 8,                     \
 486           "Decay factor to YoungedGenerationSizeSupplement")                \
 487           range(1, max_uintx)                                               \
 488                                                                             \
 489   product(uintx, TenuredGenerationSizeIncrement, 20,                        \
 490           "Adaptive size percentage change in tenured generation")          \
 491           range(0, 100)                                                     \
 492                                                                             \
 493   product(uintx, TenuredGenerationSizeSupplement, 80,                       \
 494           "Supplement to TenuredGenerationSizeIncrement used at startup")   \
 495           range(0, 100)                                                     \
 496                                                                             \
 497   product(uintx, TenuredGenerationSizeSupplementDecay, 2,                   \
 498           "Decay factor to TenuredGenerationSizeIncrement")                 \
 499           range(1, max_uintx)                                               \
 500                                                                             \
 501   product(uintx, MaxGCPauseMillis, max_uintx - 1,                           \
 502           "Adaptive size policy maximum GC pause time goal in millisecond, "\
 503           "or (G1 Only) the maximum GC time per MMU time slice")            \
 504           range(1, max_uintx - 1)                                           \
 505           constraint(MaxGCPauseMillisConstraintFunc,AfterErgo)              \
 506                                                                             \
 507   product(uintx, GCPauseIntervalMillis, 0,                                  \
 508           "Time slice for MMU specification")                               \
 509           constraint(GCPauseIntervalMillisConstraintFunc,AfterErgo)         \
 510                                                                             \
 511   product(uintx, MaxGCMinorPauseMillis, max_uintx,                          \
 512           "Adaptive size policy maximum GC minor pause time goal "          \
 513           "in millisecond")                                                 \
 514           range(0, max_uintx)                                               \
 515                                                                             \
 516   product(uintx, GCTimeRatio, 99,                                           \
 517           "Adaptive size policy application time to GC time ratio")         \
 518           range(0, max_juint)                                               \
 519                                                                             \
 520   product(uintx, AdaptiveSizeDecrementScaleFactor, 4,                       \
 521           "Adaptive size scale down factor for shrinking")                  \
 522           range(1, max_uintx)                                               \
 523                                                                             \
 524   product(bool, UseAdaptiveSizeDecayMajorGCCost, true,                      \
 525           "Adaptive size decays the major cost for long major intervals")   \
 526                                                                             \
 527   product(uintx, AdaptiveSizeMajorGCDecayTimeScale, 10,                     \
 528           "Time scale over which major costs decay")                        \
 529           range(0, max_uintx)                                               \
 530                                                                             \
 531   product(uintx, MinSurvivorRatio, 3,                                       \
 532           "Minimum ratio of young generation/survivor space size")          \
 533           range(3, max_uintx)                                               \
 534                                                                             \
 535   product(uintx, InitialSurvivorRatio, 8,                                   \
 536           "Initial ratio of young generation/survivor space size")          \
 537           range(0, max_uintx)                                               \
 538                                                                             \
 539   product(size_t, BaseFootPrintEstimate, 256*M,                             \
 540           "Estimate of footprint other than Java Heap")                     \
 541           range(0, max_uintx)                                               \
 542                                                                             \
 543   product(bool, UseGCOverheadLimit, true,                                   \
 544           "Use policy to limit of proportion of time spent in GC "          \
 545           "before an OutOfMemory error is thrown")                          \
 546                                                                             \
 547   product(uintx, GCTimeLimit, 98,                                           \
 548           "Limit of the proportion of time spent in GC before "             \
 549           "an OutOfMemoryError is thrown (used with GCHeapFreeLimit)")      \
 550           range(0, 100)                                                     \
 551                                                                             \
 552   product(uintx, GCHeapFreeLimit, 2,                                        \
 553           "Minimum percentage of free space after a full GC before an "     \
 554           "OutOfMemoryError is thrown (used with GCTimeLimit)")             \
 555           range(0, 100)                                                     \
 556                                                                             \
 557   develop(uintx, GCOverheadLimitThreshold, 5,                               \
 558           "Number of consecutive collections before gc time limit fires")   \
 559           range(1, max_uintx)                                               \
 560                                                                             \
 561   product(intx, PrefetchCopyIntervalInBytes, -1,                            \
 562           "How far ahead to prefetch destination area (<= 0 means off)")    \
 563           range(-1, max_jint)                                               \
 564                                                                             \
 565   product(intx, PrefetchScanIntervalInBytes, -1,                            \
 566           "How far ahead to prefetch scan area (<= 0 means off)")           \
 567           range(-1, max_jint)                                               \
 568                                                                             \
 569   product(intx, PrefetchFieldsAhead, -1,                                    \
 570           "How many fields ahead to prefetch in oop scan (<= 0 means off)") \
 571           range(-1, max_jint)                                               \
 572                                                                             \
 573   diagnostic(bool, VerifyDuringStartup, false,                              \
 574           "Verify memory system before executing any Java code "            \
 575           "during VM initialization")                                       \
 576                                                                             \
 577   diagnostic(bool, VerifyBeforeExit, trueInDebug,                           \
 578           "Verify system before exiting")                                   \
 579                                                                             \
 580   diagnostic(bool, VerifyBeforeGC, false,                                   \
 581           "Verify memory system before GC")                                 \
 582                                                                             \
 583   diagnostic(bool, VerifyAfterGC, false,                                    \
 584           "Verify memory system after GC")                                  \
 585                                                                             \
 586   diagnostic(bool, VerifyDuringGC, false,                                   \
 587           "Verify memory system during GC (between phases)")                \
 588                                                                             \
 589   diagnostic(ccstrlist, VerifyGCType, "",                                   \
 590              "GC type(s) to verify when Verify*GC is enabled."              \
 591              "Available types are collector specific.")                     \
 592                                                                             \
 593   diagnostic(ccstrlist, VerifySubSet, "",                                   \
 594           "Memory sub-systems to verify when Verify*GC flag(s) "            \
 595           "are enabled. One or more sub-systems can be specified "          \
 596           "in a comma separated string. Sub-systems are: "                  \
 597           "threads, heap, symbol_table, string_table, codecache, "          \
 598           "dictionary, classloader_data_graph, metaspace, jni_handles, "    \
 599           "codecache_oops")                                                 \
 600                                                                             \
 601   diagnostic(bool, GCParallelVerificationEnabled, true,                     \
 602           "Enable parallel memory system verification")                     \
 603                                                                             \
 604   diagnostic(bool, DeferInitialCardMark, false,                             \
 605           "When +ReduceInitialCardMarks, explicitly defer any that "        \
 606           "may arise from new_pre_store_barrier")                           \
 607                                                                             \
 608   product(bool, UseCondCardMark, false,                                     \
 609           "Check for already marked card before updating card table")       \
 610                                                                             \
 611   diagnostic(bool, VerifyRememberedSets, false,                             \
 612           "Verify GC remembered sets")                                      \
 613                                                                             \
 614   diagnostic(bool, VerifyObjectStartArray, true,                            \
 615           "Verify GC object start array if verify before/after")            \
 616                                                                             \
 617   product(bool, DisableExplicitGC, false,                                   \
 618           "Ignore calls to System.gc()")                                    \
 619                                                                             \
 620   product(bool, PrintGC, false,                                             \
 621           "Print message at garbage collection. "                           \
 622           "Deprecated, use -Xlog:gc instead.")                              \
 623                                                                             \
 624   product(bool, PrintGCDetails, false,                                      \
 625           "Print more details at garbage collection. "                      \
 626           "Deprecated, use -Xlog:gc* instead.")                             \
 627                                                                             \
 628   develop(intx, ConcGCYieldTimeout, 0,                                      \
 629           "If non-zero, assert that GC threads yield within this "          \
 630           "number of milliseconds")                                         \
 631           range(0, max_intx)                                                \
 632                                                                             \
 633   notproduct(intx, ScavengeALotInterval,     1,                             \
 634           "Interval between which scavenge will occur with +ScavengeALot")  \
 635                                                                             \
 636   notproduct(intx, FullGCALotInterval,     1,                               \
 637           "Interval between which full gc will occur with +FullGCALot")     \
 638                                                                             \
 639   notproduct(intx, FullGCALotStart,     0,                                  \
 640           "For which invocation to start FullGCAlot")                       \
 641                                                                             \
 642   notproduct(intx, FullGCALotDummies,  32*K,                                \
 643           "Dummy object allocated with +FullGCALot, forcing all objects "   \
 644           "to move")                                                        \
 645                                                                             \
 646   /* gc parameters */                                                       \
 647   product(size_t, MinHeapSize, 0,                                           \
 648           "Minimum heap size (in bytes); zero means use ergonomics")        \
 649           constraint(MinHeapSizeConstraintFunc,AfterErgo)                   \
 650                                                                             \
 651   product(size_t, InitialHeapSize, 0,                                       \
 652           "Initial heap size (in bytes); zero means use ergonomics")        \
 653           constraint(InitialHeapSizeConstraintFunc,AfterErgo)               \
 654                                                                             \
 655   product(size_t, MaxHeapSize, ScaleForWordSize(96*M),                      \
 656           "Maximum heap size (in bytes)")                                   \
 657           constraint(MaxHeapSizeConstraintFunc,AfterErgo)                   \
 658                                                                             \
 659   manageable(size_t, SoftMaxHeapSize, 0,                                    \
 660           "Soft limit for maximum heap size (in bytes)")                    \
 661           constraint(SoftMaxHeapSizeConstraintFunc,AfterMemoryInit)         \
 662                                                                             \
 663   product(size_t, OldSize, ScaleForWordSize(4*M),                           \
 664           "Initial tenured generation size (in bytes)")                     \
 665           range(0, max_uintx)                                               \
 666                                                                             \
 667   product(size_t, NewSize, ScaleForWordSize(1*M),                           \
 668           "Initial new generation size (in bytes)")                         \
 669           constraint(NewSizeConstraintFunc,AfterErgo)                       \
 670                                                                             \
 671   product(size_t, MaxNewSize, max_uintx,                                    \
 672           "Maximum new generation size (in bytes), max_uintx means set "    \
 673           "ergonomically")                                                  \
 674           range(0, max_uintx)                                               \
 675                                                                             \
 676   product_pd(size_t, HeapBaseMinAddress,                                    \
 677           "OS specific low limit for heap base address")                    \
 678           constraint(HeapBaseMinAddressConstraintFunc,AfterErgo)            \
 679                                                                             \
 680   product(size_t, PretenureSizeThreshold, 0,                                \
 681           "Maximum size in bytes of objects allocated in DefNew "           \
 682           "generation; zero means no maximum")                              \
 683           range(0, max_uintx)                                               \
 684                                                                             \
 685   product(size_t, MinTLABSize, 2*K,                                         \
 686           "Minimum allowed TLAB size (in bytes)")                           \
 687           range(1, max_uintx/2)                                             \
 688           constraint(MinTLABSizeConstraintFunc,AfterMemoryInit)             \
 689                                                                             \
 690   product(size_t, TLABSize, 0,                                              \
 691           "Starting TLAB size (in bytes); zero means set ergonomically")    \
 692           constraint(TLABSizeConstraintFunc,AfterMemoryInit)                \
 693                                                                             \
 694   product(size_t, YoungPLABSize, 4096,                                      \
 695           "Size of young gen promotion LAB's (in HeapWords)")               \
 696           constraint(YoungPLABSizeConstraintFunc,AfterMemoryInit)           \
 697                                                                             \
 698   product(size_t, OldPLABSize, 1024,                                        \
 699           "Size of old gen promotion LAB's (in HeapWords)")                 \
 700           constraint(OldPLABSizeConstraintFunc,AfterMemoryInit)             \
 701                                                                             \
 702   product(uintx, TLABAllocationWeight, 35,                                  \
 703           "Allocation averaging weight")                                    \
 704           range(0, 100)                                                     \
 705                                                                             \
 706   /* Limit the lower bound of this flag to 1 as it is used  */              \
 707   /* in a division expression.                              */              \
 708   product(uintx, TLABWasteTargetPercent, 1,                                 \
 709           "Percentage of Eden that can be wasted")                          \
 710           range(1, 100)                                                     \
 711                                                                             \
 712   product(uintx, TLABRefillWasteFraction,    64,                            \
 713           "Maximum TLAB waste at a refill (internal fragmentation)")        \
 714           range(1, max_juint)                                               \
 715                                                                             \
 716   product(uintx, TLABWasteIncrement,    4,                                  \
 717           "Increment allowed waste at slow allocation")                     \
 718           range(0, max_jint)                                                \
 719           constraint(TLABWasteIncrementConstraintFunc,AfterMemoryInit)      \
 720                                                                             \
 721   product(uintx, SurvivorRatio, 8,                                          \
 722           "Ratio of eden/survivor space size")                              \
 723           range(1, max_uintx-2)                                             \
 724           constraint(SurvivorRatioConstraintFunc,AfterMemoryInit)           \
 725                                                                             \
 726   product(uintx, NewRatio, 2,                                               \
 727           "Ratio of old/new generation sizes")                              \
 728           range(0, max_uintx-1)                                             \
 729                                                                             \
 730   product_pd(size_t, NewSizeThreadIncrease,                                 \
 731           "Additional size added to desired new generation size per "       \
 732           "non-daemon thread (in bytes)")                                   \
 733           range(0, max_uintx)                                               \
 734                                                                             \
 735   product(uintx, QueuedAllocationWarningCount, 0,                           \
 736           "Number of times an allocation that queues behind a GC "          \
 737           "will retry before printing a warning")                           \
 738           range(0, max_uintx)                                               \
 739                                                                             \
 740   diagnostic(uintx, VerifyGCStartAt,   0,                                   \
 741           "GC invoke count where +VerifyBefore/AfterGC kicks in")           \
 742           range(0, max_uintx)                                               \
 743                                                                             \
 744   diagnostic(intx, VerifyGCLevel,     0,                                    \
 745           "Generation level at which to start +VerifyBefore/AfterGC")       \
 746           range(0, 1)                                                       \
 747                                                                             \
 748   product(uintx, MaxTenuringThreshold,    15,                               \
 749           "Maximum value for tenuring threshold")                           \
 750           range(0, markWord::max_age + 1)                                   \
 751           constraint(MaxTenuringThresholdConstraintFunc,AfterErgo)          \
 752                                                                             \
 753   product(uintx, InitialTenuringThreshold,    7,                            \
 754           "Initial value for tenuring threshold")                           \
 755           range(0, markWord::max_age + 1)                                   \
 756           constraint(InitialTenuringThresholdConstraintFunc,AfterErgo)      \
 757                                                                             \
 758   product(uintx, TargetSurvivorRatio,    50,                                \
 759           "Desired percentage of survivor space used after scavenge")       \
 760           range(0, 100)                                                     \
 761                                                                             \
 762   product(uintx, MarkSweepDeadRatio,     5,                                 \
 763           "Percentage (0-100) of the old gen allowed as dead wood. "        \
 764           "Serial mark sweep treats this as both the minimum and maximum "  \
 765           "value. "                                                         \
 766           "Par compact uses a variable scale based on the density of the "  \
 767           "generation and treats this as the maximum value when the heap "  \
 768           "is either completely full or completely empty.  Par compact "    \
 769           "also has a smaller default value; see arguments.cpp.")           \
 770           range(0, 100)                                                     \
 771                                                                             \
 772   product(uint, MarkSweepAlwaysCompactCount,     4,                         \
 773           "How often should we fully compact the heap (ignoring the dead "  \
 774           "space parameters)")                                              \
 775           range(1, max_juint)                                               \
 776                                                                             \
 777   develop(uintx, GCExpandToAllocateDelayMillis, 0,                          \
 778           "Delay between expansion and allocation (in milliseconds)")       \
 779                                                                             \
 780   product(uintx, GCDrainStackTargetSize, 64,                                \
 781           "Number of entries we will try to leave on the stack "            \
 782           "during parallel gc")                                             \
 783           range(0, max_juint)
 784 
 785 #endif // SHARE_GC_SHARED_GC_GLOBALS_HPP