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