1 /*
   2  * Copyright (c) 2001, 2019, 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_G1_G1_GLOBALS_HPP
  26 #define SHARE_GC_G1_G1_GLOBALS_HPP
  27 
  28 #include "runtime/globals_shared.hpp"
  29 
  30 //
  31 // Defines all globals flags used by the garbage-first compiler.
  32 //
  33 
  34 #define GC_G1_FLAGS(develop,                                                \
  35                     develop_pd,                                             \
  36                     product,                                                \
  37                     product_pd,                                             \
  38                     diagnostic,                                             \
  39                     diagnostic_pd,                                          \
  40                     experimental,                                           \
  41                     notproduct,                                             \
  42                     manageable,                                             \
  43                     product_rw,                                             \
  44                     lp64_product,                                           \
  45                     range,                                                  \
  46                     constraint,                                             \
  47                     writeable)                                              \
  48                                                                             \
  49   product(bool, G1UseAdaptiveIHOP, true,                                    \
  50           "Adaptively adjust the initiating heap occupancy from the "       \
  51           "initial value of InitiatingHeapOccupancyPercent. The policy "    \
  52           "attempts to start marking in time based on application "         \
  53           "behavior.")                                                      \
  54                                                                             \
  55   experimental(size_t, G1AdaptiveIHOPNumInitialSamples, 3,                  \
  56           "How many completed time periods from initial mark to first "     \
  57           "mixed gc are required to use the input values for prediction "   \
  58           "of the optimal occupancy to start marking.")                     \
  59           range(1, max_intx)                                                \
  60                                                                             \
  61   product(uintx, G1ConfidencePercent, 50,                                   \
  62           "Confidence level for MMU/pause predictions")                     \
  63           range(0, 100)                                                     \
  64                                                                             \
  65   diagnostic(intx, G1SummarizeRSetStatsPeriod, 0,                           \
  66           "The period (in number of GCs) at which we will generate "        \
  67           "update buffer processing info "                                  \
  68           "(0 means do not periodically generate this info); "              \
  69           "it also requires that logging is enabled on the trace"           \
  70           "level for gc+remset")                                            \
  71           range(0, max_intx)                                                \
  72                                                                             \
  73   product(double, G1ConcMarkStepDurationMillis, 10.0,                       \
  74           "Target duration of individual concurrent marking steps "         \
  75           "in milliseconds.")                                               \
  76           range(1.0, DBL_MAX)                                               \
  77                                                                             \
  78   product(uint, G1RefProcDrainInterval, 1000,                               \
  79           "The number of discovered reference objects to process before "   \
  80           "draining concurrent marking work queues.")                       \
  81           range(1, INT_MAX)                                                 \
  82                                                                             \
  83   experimental(bool, G1UseReferencePrecleaning, true,                       \
  84                "Concurrently preclean java.lang.ref.references instances "  \
  85                "before the Remark pause.")                                  \
  86                                                                             \
  87   experimental(double, G1LastPLABAverageOccupancy, 50.0,                    \
  88                "The expected average occupancy of the last PLAB in "        \
  89                "percent.")                                                  \
  90                range(0.001, 100.0)                                          \
  91                                                                             \
  92   product(size_t, G1SATBBufferSize, 1*K,                                    \
  93           "Number of entries in an SATB log buffer.")                       \
  94           range(1, max_uintx)                                               \
  95                                                                             \
  96   develop(intx, G1SATBProcessCompletedThreshold, 20,                        \
  97           "Number of completed buffers that triggers log processing.")      \
  98           range(0, max_jint)                                                \
  99                                                                             \
 100   product(uintx, G1SATBBufferEnqueueingThresholdPercent, 60,                \
 101           "Before enqueueing them, each mutator thread tries to do some "   \
 102           "filtering on the SATB buffers it generates. If post-filtering "  \
 103           "the percentage of retained entries is over this threshold "      \
 104           "the buffer will be enqueued for processing. A value of 0 "       \
 105           "specifies that mutator threads should not do such filtering.")   \
 106           range(0, 100)                                                     \
 107                                                                             \
 108   experimental(intx, G1ExpandByPercentOfAvailable, 20,                      \
 109           "When expanding, % of uncommitted space to claim.")               \
 110           range(0, 100)                                                     \
 111                                                                             \
 112   product(size_t, G1UpdateBufferSize, 256,                                  \
 113           "Size of an update buffer")                                       \
 114           range(1, NOT_LP64(32*M) LP64_ONLY(1*G))                           \
 115                                                                             \
 116   product(size_t, G1ConcRefinementYellowZone, 0,                            \
 117           "Number of enqueued update buffers that will "                    \
 118           "trigger concurrent processing. Will be selected ergonomically "  \
 119           "by default.")                                                    \
 120           range(0, max_intx)                                                \
 121                                                                             \
 122   product(size_t, G1ConcRefinementRedZone, 0,                               \
 123           "Maximum number of enqueued update buffers before mutator "       \
 124           "threads start processing new ones instead of enqueueing them. "  \
 125           "Will be selected ergonomically by default.")                     \
 126           range(0, max_intx)                                                \
 127                                                                             \
 128   product(size_t, G1ConcRefinementGreenZone, 0,                             \
 129           "The number of update buffers that are left in the queue by the " \
 130           "concurrent processing threads. Will be selected ergonomically "  \
 131           "by default.")                                                    \
 132           range(0, max_intx)                                                \
 133                                                                             \
 134   product(uintx, G1ConcRefinementServiceIntervalMillis, 300,                \
 135           "The last concurrent refinement thread wakes up every "           \
 136           "specified number of milliseconds to do miscellaneous work.")     \
 137           range(0, max_jint)                                                \
 138                                                                             \
 139   product(size_t, G1ConcRefinementThresholdStep, 2,                         \
 140           "Each time the rset update queue increases by this amount "       \
 141           "activate the next refinement thread if available. "              \
 142           "The actual step size will be selected ergonomically by "         \
 143           "default, with this value used to determine a lower bound.")      \
 144           range(1, SIZE_MAX)                                                \
 145                                                                             \
 146   product(intx, G1RSetUpdatingPauseTimePercent, 10,                         \
 147           "A target percentage of time that is allowed to be spend on "     \
 148           "process RS update buffers during the collection pause.")         \
 149           range(0, 100)                                                     \
 150                                                                             \
 151   product(bool, G1UseAdaptiveConcRefinement, true,                          \
 152           "Select green, yellow and red zones adaptively to meet the "      \
 153           "the pause requirements.")                                        \
 154                                                                             \
 155   product(size_t, G1ConcRSLogCacheSize, 10,                                 \
 156           "Log base 2 of the length of conc RS hot-card cache.")            \
 157           range(0, 27)                                                      \
 158                                                                             \
 159   product(uintx, G1ConcRSHotCardLimit, 4,                                   \
 160           "The threshold that defines (>=) a hot card.")                    \
 161           range(0, max_jubyte)                                              \
 162                                                                             \
 163   develop(intx, G1RSetRegionEntriesBase, 256,                               \
 164           "Max number of regions in a fine-grain table per MB.")            \
 165           range(1, max_jint/wordSize)                                       \
 166                                                                             \
 167   product(intx, G1RSetRegionEntries, 0,                                     \
 168           "Max number of regions for which we keep bitmaps."                \
 169           "Will be set ergonomically by default")                           \
 170           range(0, max_jint/wordSize)                                       \
 171           constraint(G1RSetRegionEntriesConstraintFunc,AfterErgo)           \
 172                                                                             \
 173   develop(intx, G1RSetSparseRegionEntriesBase, 4,                           \
 174           "Max number of entries per region in a sparse table "             \
 175           "per MB.")                                                        \
 176           range(1, max_jint/wordSize)                                       \
 177                                                                             \
 178   product(intx, G1RSetSparseRegionEntries, 0,                               \
 179           "Max number of entries per region in a sparse table."             \
 180           "Will be set ergonomically by default.")                          \
 181           range(0, max_jint/wordSize)                                       \
 182           constraint(G1RSetSparseRegionEntriesConstraintFunc,AfterErgo)     \
 183                                                                             \
 184   develop(intx, G1MaxVerifyFailures, -1,                                    \
 185           "The maximum number of verification failures to print.  "         \
 186           "-1 means print all.")                                            \
 187           range(-1, max_jint)                                               \
 188                                                                             \
 189   product(uintx, G1ReservePercent, 10,                                      \
 190           "It determines the minimum reserve we should have in the heap "   \
 191           "to minimize the probability of promotion failure.")              \
 192           range(0, 50)                                                      \
 193                                                                             \
 194   product(size_t, G1HeapRegionSize, 0,                                      \
 195           "Size of the G1 regions.")                                        \
 196           range(0, 32*M)                                                    \
 197           constraint(G1HeapRegionSizeConstraintFunc,AfterMemoryInit)        \
 198                                                                             \
 199   product(uint, G1ConcRefinementThreads, 0,                                 \
 200           "The number of parallel rem set update threads. "                 \
 201           "Will be set ergonomically by default.")                          \
 202           range(0, (max_jint-1)/wordSize)                                   \
 203                                                                             \
 204   develop(bool, G1VerifyCTCleanup, false,                                   \
 205           "Verify card table cleanup.")                                     \
 206                                                                             \
 207   product(size_t, G1RSetScanBlockSize, 64,                                  \
 208           "Size of a work unit of cards claimed by a worker thread"         \
 209           "during RSet scanning.")                                          \
 210           range(1, max_uintx)                                               \
 211                                                                             \
 212   develop(uintx, G1DummyRegionsPerGC, 0,                                    \
 213           "The number of dummy regions G1 will allocate at the end of "     \
 214           "each evacuation pause in order to artificially fill up the "     \
 215           "heap and stress the marking implementation.")                    \
 216                                                                             \
 217   develop(bool, G1ExitOnExpansionFailure, false,                            \
 218           "Raise a fatal VM exit out of memory failure in the event "       \
 219           " that heap expansion fails due to running out of swap.")         \
 220                                                                             \
 221   experimental(uintx, G1MaxNewSizePercent, 60,                              \
 222           "Percentage (0-100) of the heap size to use as default "          \
 223           " maximum young gen size.")                                       \
 224           range(0, 100)                                                     \
 225           constraint(G1MaxNewSizePercentConstraintFunc,AfterErgo)           \
 226                                                                             \
 227   experimental(uintx, G1NewSizePercent, 5,                                  \
 228           "Percentage (0-100) of the heap size to use as default "          \
 229           "minimum young gen size.")                                        \
 230           range(0, 100)                                                     \
 231           constraint(G1NewSizePercentConstraintFunc,AfterErgo)              \
 232                                                                             \
 233   experimental(uintx, G1MixedGCLiveThresholdPercent, 85,                    \
 234           "Threshold for regions to be considered for inclusion in the "    \
 235           "collection set of mixed GCs. "                                   \
 236           "Regions with live bytes exceeding this will not be collected.")  \
 237           range(0, 100)                                                     \
 238                                                                             \
 239   product(uintx, G1HeapWastePercent, 5,                                     \
 240           "Amount of space, expressed as a percentage of the heap size, "   \
 241           "that G1 is willing not to collect to avoid expensive GCs.")      \
 242           range(0, 100)                                                     \
 243                                                                             \
 244   product(uintx, G1MixedGCCountTarget, 8,                                   \
 245           "The target number of mixed GCs after a marking cycle.")          \
 246           range(0, max_uintx)                                               \
 247                                                                             \
 248   experimental(bool, G1PretouchAuxiliaryMemory, false,                      \
 249           "Pre-touch large auxiliary data structures used by the GC.")      \
 250                                                                             \
 251   experimental(bool, G1EagerReclaimHumongousObjects, true,                  \
 252           "Try to reclaim dead large objects at every young GC.")           \
 253                                                                             \
 254   experimental(bool, G1EagerReclaimHumongousObjectsWithStaleRefs, true,     \
 255           "Try to reclaim dead large objects that have a few stale "        \
 256           "references at every young GC.")                                  \
 257                                                                             \
 258   experimental(size_t, G1RebuildRemSetChunkSize, 256 * K,                   \
 259           "Chunk size used for rebuilding the remembered set.")             \
 260           range(4 * K, 32 * M)                                              \
 261                                                                             \
 262   experimental(uintx, G1OldCSetRegionThresholdPercent, 10,                  \
 263           "An upper bound for the number of old CSet regions expressed "    \
 264           "as a percentage of the heap size.")                              \
 265           range(0, 100)                                                     \
 266                                                                             \
 267   notproduct(bool, G1EvacuationFailureALot, false,                          \
 268           "Force use of evacuation failure handling during certain "        \
 269           "evacuation pauses")                                              \
 270                                                                             \
 271   develop(uintx, G1EvacuationFailureALotCount, 1000,                        \
 272           "Number of successful evacuations between evacuation failures "   \
 273           "occurring at object copying")                                    \
 274                                                                             \
 275   develop(uintx, G1EvacuationFailureALotInterval, 5,                        \
 276           "Total collections between forced triggering of evacuation "      \
 277           "failures")                                                       \
 278                                                                             \
 279   develop(bool, G1EvacuationFailureALotDuringConcMark, true,                \
 280           "Force use of evacuation failure handling during evacuation "     \
 281           "pauses when marking is in progress")                             \
 282                                                                             \
 283   develop(bool, G1EvacuationFailureALotDuringInitialMark, true,             \
 284           "Force use of evacuation failure handling during initial mark "   \
 285           "evacuation pauses")                                              \
 286                                                                             \
 287   develop(bool, G1EvacuationFailureALotDuringYoungGC, true,                 \
 288           "Force use of evacuation failure handling during young "          \
 289           "evacuation pauses")                                              \
 290                                                                             \
 291   develop(bool, G1EvacuationFailureALotDuringMixedGC, true,                 \
 292           "Force use of evacuation failure handling during mixed "          \
 293           "evacuation pauses")                                              \
 294                                                                             \
 295   diagnostic(bool, G1VerifyRSetsDuringFullGC, false,                        \
 296           "If true, perform verification of each heap region's "            \
 297           "remembered set when verifying the heap during a full GC.")       \
 298                                                                             \
 299   diagnostic(bool, G1VerifyHeapRegionCodeRoots, false,                      \
 300           "Verify the code root lists attached to each heap region.")       \
 301                                                                             \
 302   develop(bool, G1VerifyBitmaps, false,                                     \
 303           "Verifies the consistency of the marking bitmaps")                \
 304                                                                             \
 305   manageable(uintx, G1PeriodicGCInterval, 0,                                \
 306           "Number of milliseconds after a previous GC to wait before "      \
 307           "triggering a periodic gc. A value of zero disables periodically "\
 308           "enforced gc cycles.")                                            \
 309                                                                             \
 310   product(bool, G1PeriodicGCInvokesConcurrent, true,                        \
 311           "Determines the kind of periodic GC. Set to true to have G1 "     \
 312           "perform a concurrent GC as periodic GC, otherwise use a STW "    \
 313           "Full GC.")                                                       \
 314                                                                             \
 315   manageable(double, G1PeriodicGCSystemLoadThreshold, 0.0,                  \
 316           "Maximum recent system wide load as returned by the 1m value "    \
 317           "of getloadavg() at which G1 triggers a periodic GC. A load "     \
 318           "above this value cancels a given periodic GC. A value of zero "  \
 319           "disables this check.")                                           \
 320           range(0.0, (double)max_uintx)                                     \
 321                                                                             \
 322   experimental(uintx, G1YoungExpansionBufferPercent, 10,                    \
 323                "When heterogenous heap is enabled by AllocateOldGenAt "     \
 324                "option, after every GC, young gen is re-sized which "       \
 325                "involves system calls to commit/uncommit memory. To "       \
 326                "reduce these calls, we keep a buffer of extra regions to "  \
 327                "absorb small changes in young gen length. This flag takes " \
 328                "the buffer size as an percentage of young gen length")      \
 329                range(0, 100)                                                \
 330 
 331 
 332 #endif // SHARE_GC_G1_G1_GLOBALS_HPP