1 /*
   2  * Copyright (c) 2001, 2015, 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_VM_GC_G1_G1_GLOBALS_HPP
  26 #define SHARE_VM_GC_G1_G1_GLOBALS_HPP
  27 
  28 #include "runtime/globals.hpp"
  29 #include <float.h> // for DBL_MAX
  30 //
  31 // Defines all globals flags used by the garbage-first compiler.
  32 //
  33 
  34 #define G1_FLAGS(develop, develop_pd, product, product_pd, diagnostic, experimental, notproduct, manageable, product_rw, range, constraint) \
  35                                                                             \
  36   product(bool, G1UseAdaptiveIHOP, false,                                   \
  37           "Adaptively adjust InitiatingHeapOccupancyPercent from the "      \
  38           "initial value.")                                                 \
  39                                                                             \
  40   product(uintx, G1ConfidencePercent, 50,                                   \
  41           "Confidence level for MMU/pause predictions")                     \
  42           range(0, 100)                                                     \
  43                                                                             \
  44   develop(intx, G1MarkingOverheadPercent, 0,                                \
  45           "Overhead of concurrent marking")                                 \
  46           range(0, 100)                                                     \
  47                                                                             \
  48   develop(intx, G1MarkingVerboseLevel, 0,                                   \
  49           "Level (0-4) of verboseness of the marking code")                 \
  50           range(0, 4)                                                       \
  51                                                                             \
  52   develop(bool, G1TraceMarkStackOverflow, false,                            \
  53           "If true, extra debugging code for CM restart for ovflw.")        \
  54                                                                             \
  55   develop(bool, G1TraceHeapRegionRememberedSet, false,                      \
  56           "Enables heap region remembered set debug logs")                  \
  57                                                                             \
  58   diagnostic(bool, G1SummarizeConcMark, false,                              \
  59           "Summarize concurrent mark info")                                 \
  60                                                                             \
  61   diagnostic(bool, G1SummarizeRSetStats, false,                             \
  62           "Summarize remembered set processing info")                       \
  63                                                                             \
  64   diagnostic(intx, G1SummarizeRSetStatsPeriod, 0,                           \
  65           "The period (in number of GCs) at which we will generate "        \
  66           "update buffer processing info "                                  \
  67           "(0 means do not periodically generate this info); "              \
  68           "it also requires -XX:+G1SummarizeRSetStats")                     \
  69           range(0, max_intx)                                                \
  70                                                                             \
  71   diagnostic(bool, G1TraceConcRefinement, false,                            \
  72           "Trace G1 concurrent refinement")                                 \
  73                                                                             \
  74   experimental(bool, G1TraceStringSymbolTableScrubbing, false,              \
  75           "Trace information string and symbol table scrubbing.")           \
  76                                                                             \
  77   product(double, G1ConcMarkStepDurationMillis, 10.0,                       \
  78           "Target duration of individual concurrent marking steps "         \
  79           "in milliseconds.")                                               \
  80           range(1.0, DBL_MAX)                                               \
  81                                                                             \
  82   product(intx, G1RefProcDrainInterval, 10,                                 \
  83           "The number of discovered reference objects to process before "   \
  84           "draining concurrent marking work queues.")                       \
  85           range(1, max_intx)                                                \
  86                                                                             \
  87   experimental(bool, G1UseConcMarkReferenceProcessing, true,                \
  88           "If true, enable reference discovery during concurrent "          \
  89           "marking and reference processing at the end of remark.")         \
  90                                                                             \
  91   experimental(double, G1LastPLABAverageOccupancy, 50.0,                    \
  92                "The expected average occupancy of the last PLAB in "        \
  93                "percent.")                                                  \
  94                range(0.001, 100.0)                                          \
  95                                                                             \
  96   product(size_t, G1SATBBufferSize, 1*K,                                    \
  97           "Number of entries in an SATB log buffer.")                       \
  98           range(1, max_uintx)                                               \
  99                                                                             \
 100   develop(intx, G1SATBProcessCompletedThreshold, 20,                        \
 101           "Number of completed buffers that triggers log processing.")      \
 102           range(0, max_jint)                                                \
 103                                                                             \
 104   product(uintx, G1SATBBufferEnqueueingThresholdPercent, 60,                \
 105           "Before enqueueing them, each mutator thread tries to do some "   \
 106           "filtering on the SATB buffers it generates. If post-filtering "  \
 107           "the percentage of retained entries is over this threshold "      \
 108           "the buffer will be enqueued for processing. A value of 0 "       \
 109           "specifies that mutator threads should not do such filtering.")   \
 110           range(0, 100)                                                     \
 111                                                                             \
 112   experimental(intx, G1ExpandByPercentOfAvailable, 20,                      \
 113           "When expanding, % of uncommitted space to claim.")               \
 114           range(0, 100)                                                     \
 115                                                                             \
 116   develop(bool, G1RSBarrierRegionFilter, true,                              \
 117           "If true, generate region filtering code in RS barrier")          \
 118                                                                             \
 119   diagnostic(bool, G1PrintRegionLivenessInfo, false,                        \
 120             "Prints the liveness information for all regions in the heap "  \
 121             "at the end of a marking cycle.")                               \
 122                                                                             \
 123   product(size_t, G1UpdateBufferSize, 256,                                  \
 124           "Size of an update buffer")                                       \
 125           range(1, NOT_LP64(32*M) LP64_ONLY(1*G))                           \
 126                                                                             \
 127   product(intx, G1ConcRefinementYellowZone, 0,                              \
 128           "Number of enqueued update buffers that will "                    \
 129           "trigger concurrent processing. Will be selected ergonomically "  \
 130           "by default.")                                                    \
 131           range(0, max_intx)                                                \
 132                                                                             \
 133   product(intx, G1ConcRefinementRedZone, 0,                                 \
 134           "Maximum number of enqueued update buffers before mutator "       \
 135           "threads start processing new ones instead of enqueueing them. "  \
 136           "Will be selected ergonomically by default. Zero will disable "   \
 137           "concurrent processing.")                                         \
 138           range(0, max_intx)                                                \
 139                                                                             \
 140   product(intx, G1ConcRefinementGreenZone, 0,                               \
 141           "The number of update buffers that are left in the queue by the " \
 142           "concurrent processing threads. Will be selected ergonomically "  \
 143           "by default.")                                                    \
 144           range(0, max_intx)                                                \
 145                                                                             \
 146   product(intx, G1ConcRefinementServiceIntervalMillis, 300,                 \
 147           "The last concurrent refinement thread wakes up every "           \
 148           "specified number of milliseconds to do miscellaneous work.")     \
 149           range(0, max_jint)                                                \
 150                                                                             \
 151   product(intx, G1ConcRefinementThresholdStep, 0,                           \
 152           "Each time the rset update queue increases by this amount "       \
 153           "activate the next refinement thread if available. "              \
 154           "Will be selected ergonomically by default.")                     \
 155                                                                             \
 156   product(intx, G1RSetUpdatingPauseTimePercent, 10,                         \
 157           "A target percentage of time that is allowed to be spend on "     \
 158           "process RS update buffers during the collection pause.")         \
 159           range(0, 100)                                                     \
 160                                                                             \
 161   product(bool, G1UseAdaptiveConcRefinement, true,                          \
 162           "Select green, yellow and red zones adaptively to meet the "      \
 163           "the pause requirements.")                                        \
 164                                                                             \
 165   product(size_t, G1ConcRSLogCacheSize, 10,                                 \
 166           "Log base 2 of the length of conc RS hot-card cache.")            \
 167           range(0, 27)                                                      \
 168                                                                             \
 169   product(uintx, G1ConcRSHotCardLimit, 4,                                   \
 170           "The threshold that defines (>=) a hot card.")                    \
 171           range(0, max_jubyte)                                              \
 172                                                                             \
 173   develop(intx, G1RSetRegionEntriesBase, 256,                               \
 174           "Max number of regions in a fine-grain table per MB.")            \
 175           range(1, max_jint/wordSize)                                       \
 176                                                                             \
 177   product(intx, G1RSetRegionEntries, 0,                                     \
 178           "Max number of regions for which we keep bitmaps."                \
 179           "Will be set ergonomically by default")                           \
 180           range(0, max_jint/wordSize)                                       \
 181           constraint(G1RSetRegionEntriesConstraintFunc,AfterErgo)           \
 182                                                                             \
 183   develop(intx, G1RSetSparseRegionEntriesBase, 4,                           \
 184           "Max number of entries per region in a sparse table "             \
 185           "per MB.")                                                        \
 186           range(1, max_jint/wordSize)                                       \
 187                                                                             \
 188   product(intx, G1RSetSparseRegionEntries, 0,                               \
 189           "Max number of entries per region in a sparse table."             \
 190           "Will be set ergonomically by default.")                          \
 191           range(0, max_jint/wordSize)                                       \
 192           constraint(G1RSetSparseRegionEntriesConstraintFunc,AfterErgo)     \
 193                                                                             \
 194   develop(intx, G1MaxVerifyFailures, -1,                                    \
 195           "The maximum number of verification failures to print.  "         \
 196           "-1 means print all.")                                            \
 197           range(-1, max_jint)                                               \
 198                                                                             \
 199   develop(bool, G1ScrubRemSets, true,                                       \
 200           "When true, do RS scrubbing after cleanup.")                      \
 201                                                                             \
 202   develop(bool, G1RSScrubVerbose, false,                                    \
 203           "When true, do RS scrubbing with verbose output.")                \
 204                                                                             \
 205   develop(bool, G1YoungSurvRateVerbose, false,                              \
 206           "print out the survival rate of young regions according to age.") \
 207                                                                             \
 208   develop(intx, G1YoungSurvRateNumRegionsSummary, 0,                        \
 209           "the number of regions for which we'll print a surv rate "        \
 210           "summary.")                                                       \
 211           range(0, max_intx)                                                \
 212           constraint(G1YoungSurvRateNumRegionsSummaryConstraintFunc,AfterErgo)\
 213                                                                             \
 214   product(uintx, G1ReservePercent, 10,                                      \
 215           "It determines the minimum reserve we should have in the heap "   \
 216           "to minimize the probability of promotion failure.")              \
 217           range(0, 50)                                                      \
 218                                                                             \
 219   diagnostic(bool, G1PrintHeapRegions, false,                               \
 220           "If set G1 will print information on which regions are being "    \
 221           "allocated and which are reclaimed.")                             \
 222                                                                             \
 223   develop(bool, G1HRRSUseSparseTable, true,                                 \
 224           "When true, use sparse table to save space.")                     \
 225                                                                             \
 226   develop(bool, G1HRRSFlushLogBuffersOnVerify, false,                       \
 227           "Forces flushing of log buffers before verification.")            \
 228                                                                             \
 229   product(size_t, G1HeapRegionSize, 0,                                      \
 230           "Size of the G1 regions.")                                        \
 231           range(0, 32*M)                                                    \
 232           constraint(G1HeapRegionSizeConstraintFunc,AfterMemoryInit)        \
 233                                                                             \
 234   product(uintx, G1ConcRefinementThreads, 0,                                \
 235           "If non-0 is the number of parallel rem set update threads, "     \
 236           "otherwise the value is determined ergonomically.")               \
 237           range(0, (max_jint-1)/wordSize)                                   \
 238                                                                             \
 239   develop(bool, G1VerifyCTCleanup, false,                                   \
 240           "Verify card table cleanup.")                                     \
 241                                                                             \
 242   product(size_t, G1RSetScanBlockSize, 64,                                  \
 243           "Size of a work unit of cards claimed by a worker thread"         \
 244           "during RSet scanning.")                                          \
 245           range(1, max_uintx)                                               \
 246                                                                             \
 247   develop(uintx, G1SecondaryFreeListAppendLength, 5,                        \
 248           "The number of regions we will add to the secondary free list "   \
 249           "at every append operation")                                      \
 250                                                                             \
 251   develop(bool, G1ConcRegionFreeingVerbose, false,                          \
 252           "Enables verboseness during concurrent region freeing")           \
 253                                                                             \
 254   develop(bool, G1StressConcRegionFreeing, false,                           \
 255           "It stresses the concurrent region freeing operation")            \
 256                                                                             \
 257   develop(uintx, G1StressConcRegionFreeingDelayMillis, 0,                   \
 258           "Artificial delay during concurrent region freeing")              \
 259                                                                             \
 260   develop(uintx, G1DummyRegionsPerGC, 0,                                    \
 261           "The number of dummy regions G1 will allocate at the end of "     \
 262           "each evacuation pause in order to artificially fill up the "     \
 263           "heap and stress the marking implementation.")                    \
 264                                                                             \
 265   develop(bool, G1ExitOnExpansionFailure, false,                            \
 266           "Raise a fatal VM exit out of memory failure in the event "       \
 267           " that heap expansion fails due to running out of swap.")         \
 268                                                                             \
 269   develop(uintx, G1ConcMarkForceOverflow, 0,                                \
 270           "The number of times we'll force an overflow during "             \
 271           "concurrent marking")                                             \
 272                                                                             \
 273   experimental(uintx, G1MaxNewSizePercent, 60,                              \
 274           "Percentage (0-100) of the heap size to use as default "          \
 275           " maximum young gen size.")                                       \
 276           range(0, 100)                                                     \
 277           constraint(G1MaxNewSizePercentConstraintFunc,AfterErgo)           \
 278                                                                             \
 279   experimental(uintx, G1NewSizePercent, 5,                                  \
 280           "Percentage (0-100) of the heap size to use as default "          \
 281           "minimum young gen size.")                                        \
 282           range(0, 100)                                                     \
 283           constraint(G1NewSizePercentConstraintFunc,AfterErgo)              \
 284                                                                             \
 285   experimental(uintx, G1MixedGCLiveThresholdPercent, 85,                    \
 286           "Threshold for regions to be considered for inclusion in the "    \
 287           "collection set of mixed GCs. "                                   \
 288           "Regions with live bytes exceeding this will not be collected.")  \
 289           range(0, 100)                                                     \
 290                                                                             \
 291   product(uintx, G1HeapWastePercent, 5,                                     \
 292           "Amount of space, expressed as a percentage of the heap size, "   \
 293           "that G1 is willing not to collect to avoid expensive GCs.")      \
 294           range(0, 100)                                                     \
 295                                                                             \
 296   product(uintx, G1MixedGCCountTarget, 8,                                   \
 297           "The target number of mixed GCs after a marking cycle.")          \
 298                                                                             \
 299   experimental(bool, G1EagerReclaimHumongousObjects, true,                  \
 300           "Try to reclaim dead large objects at every young GC.")           \
 301                                                                             \
 302   experimental(bool, G1EagerReclaimHumongousObjectsWithStaleRefs, true,     \
 303           "Try to reclaim dead large objects that have a few stale "        \
 304           "references at every young GC.")                                  \
 305                                                                             \
 306   experimental(bool, G1TraceEagerReclaimHumongousObjects, false,            \
 307           "Print some information about large object liveness "             \
 308           "at every young GC.")                                             \
 309                                                                             \
 310   experimental(bool, G1RetainAllocRegionsDuringGC, true,                    \
 311           "Try to retain and reuse allocation regions with some space left "\
 312           "during GC.")                                                     \
 313                                                                             \
 314   experimental(uintx, G1OldCSetRegionThresholdPercent, 10,                  \
 315           "An upper bound for the number of old CSet regions expressed "    \
 316           "as a percentage of the heap size.")                              \
 317           range(0, 100)                                                     \
 318                                                                             \
 319   experimental(ccstr, G1LogLevel, NULL,                                     \
 320           "Log level for G1 logging: fine, finer, finest")                  \
 321                                                                             \
 322   notproduct(bool, G1EvacuationFailureALot, false,                          \
 323           "Force use of evacuation failure handling during certain "        \
 324           "evacuation pauses")                                              \
 325                                                                             \
 326   develop(uintx, G1EvacuationFailureALotCount, 1000,                        \
 327           "Number of successful evacuations between evacuation failures "   \
 328           "occurring at object copying")                                    \
 329                                                                             \
 330   develop(uintx, G1EvacuationFailureALotInterval, 5,                        \
 331           "Total collections between forced triggering of evacuation "      \
 332           "failures")                                                       \
 333                                                                             \
 334   develop(bool, G1EvacuationFailureALotDuringConcMark, true,                \
 335           "Force use of evacuation failure handling during evacuation "     \
 336           "pauses when marking is in progress")                             \
 337                                                                             \
 338   develop(bool, G1EvacuationFailureALotDuringInitialMark, true,             \
 339           "Force use of evacuation failure handling during initial mark "   \
 340           "evacuation pauses")                                              \
 341                                                                             \
 342   develop(bool, G1EvacuationFailureALotDuringYoungGC, true,                 \
 343           "Force use of evacuation failure handling during young "          \
 344           "evacuation pauses")                                              \
 345                                                                             \
 346   develop(bool, G1EvacuationFailureALotDuringMixedGC, true,                 \
 347           "Force use of evacuation failure handling during mixed "          \
 348           "evacuation pauses")                                              \
 349                                                                             \
 350   diagnostic(bool, G1VerifyRSetsDuringFullGC, false,                        \
 351           "If true, perform verification of each heap region's "            \
 352           "remembered set when verifying the heap during a full GC.")       \
 353                                                                             \
 354   diagnostic(bool, G1VerifyHeapRegionCodeRoots, false,                      \
 355           "Verify the code root lists attached to each heap region.")       \
 356                                                                             \
 357   develop(bool, G1VerifyBitmaps, false,                                     \
 358           "Verifies the consistency of the marking bitmaps")
 359 
 360 G1_FLAGS(DECLARE_DEVELOPER_FLAG, \
 361          DECLARE_PD_DEVELOPER_FLAG, \
 362          DECLARE_PRODUCT_FLAG, \
 363          DECLARE_PD_PRODUCT_FLAG, \
 364          DECLARE_DIAGNOSTIC_FLAG, \
 365          DECLARE_EXPERIMENTAL_FLAG, \
 366          DECLARE_NOTPRODUCT_FLAG, \
 367          DECLARE_MANAGEABLE_FLAG, \
 368          DECLARE_PRODUCT_RW_FLAG, \
 369          IGNORE_RANGE, \
 370          IGNORE_CONSTRAINT)
 371 
 372 #endif // SHARE_VM_GC_G1_G1_GLOBALS_HPP