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