< prev index next >

src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp

Print this page


   9  *
  10  * This code is distributed in the hope that it will be useful, but WITHOUT
  11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  13  * version 2 for more details (a copy is included in the LICENSE file that
  14  * accompanied this code).
  15  *
  16  * You should have received a copy of the GNU General Public License version
  17  * 2 along with this work; if not, write to the Free Software Foundation,
  18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  19  *
  20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  21  * or visit www.oracle.com if you need additional information or have any
  22  * questions.
  23  *
  24  */
  25 
  26 #ifndef SHARE_GC_SHENANDOAH_SHENANDOAH_GLOBALS_HPP
  27 #define SHARE_GC_SHENANDOAH_SHENANDOAH_GLOBALS_HPP
  28 
  29 #define GC_SHENANDOAH_FLAGS(develop,                                        \
  30                             develop_pd,                                     \
  31                             product,                                        \
  32                             product_pd,                                     \
  33                             diagnostic,                                     \
  34                             diagnostic_pd,                                  \
  35                             experimental,                                   \
  36                             notproduct,                                     \
  37                             manageable,                                     \
  38                             product_rw,                                     \
  39                             lp64_product,                                   \
  40                             range,                                          \
  41                             constraint)                                     \
  42                                                                             \
  43   experimental(size_t, ShenandoahRegionSize, 0,                             \
  44           "Static heap region size. Set zero to enable automatic sizing.")  \
  45                                                                             \
  46   experimental(size_t, ShenandoahTargetNumRegions, 2048,                    \
  47           "With automatic region sizing, this is the approximate number "   \
  48           "of regions that would be used, within min/max region size "      \
  49           "limits.")                                                        \
  50                                                                             \
  51   experimental(size_t, ShenandoahMinRegionSize, 256 * K,                    \
  52           "With automatic region sizing, the regions would be at least "    \
  53           "this large.")                                                    \
  54                                                                             \
  55   experimental(size_t, ShenandoahMaxRegionSize, 32 * M,                     \
  56           "With automatic region sizing, the regions would be at most "     \
  57           "this large.")                                                    \
  58                                                                             \
  59   experimental(intx, ShenandoahHumongousThreshold, 100,                     \
  60           "Humongous objects are allocated in separate regions. "           \
  61           "This setting defines how large the object should be to be "      \
  62           "deemed humongous. Value is in  percents of heap region size. "   \
  63           "This also caps the maximum TLAB size.")                          \
  64           range(1, 100)                                                     \
  65                                                                             \
  66   experimental(ccstr, ShenandoahGCMode, "normal",                           \
  67           "GC mode to use.  Among other things, this defines which "        \
  68           "barriers are in in use. Possible values are:"                    \
  69           " normal - default concurrent GC (three pass mark-evac-update);"  \
  70           " passive - stop the world GC only (either degenerated or full)") \
  71                                                                             \
  72   experimental(ccstr, ShenandoahGCHeuristics, "adaptive",                   \
  73           "GC heuristics to use. This fine-tunes the GC mode selected, "    \
  74           "by choosing when to start the GC, how much to process on each "  \
  75           "cycle, and what other features to automatically enable. "        \
  76           "Possible values are:"                                            \
  77           " adaptive - adapt to maintain the given amount of free heap "    \
  78           "at all times, even during the GC cycle;"                         \
  79           " static -  trigger GC when free heap falls below the threshold;" \
  80           " aggressive - run GC continuously, try to evacuate everything;"  \
  81           " compact - run GC more frequently and with deeper targets to "   \
  82           "free up more memory.")                                           \
  83                                                                             \
  84   experimental(uintx, ShenandoahRefProcFrequency, 5,                        \
  85           "Process process weak (soft, phantom, finalizers) references "    \
  86           "every Nth cycle. Normally affects concurrent GC cycles only, "   \
  87           "as degenerated and full GCs would try to process references "    \
  88           "regardless. Set to zero to disable reference processing "        \
  89           "completely.")                                                    \
  90                                                                             \
  91   experimental(uintx, ShenandoahUnloadClassesFrequency, 1,                  \
  92           "Unload the classes every Nth cycle. Normally affects concurrent "\
  93           "GC cycles, as degenerated and full GCs would try to unload "     \
  94           "classes regardless. Set to zero to disable class unloading.")    \
  95                                                                             \
  96   experimental(uintx, ShenandoahGarbageThreshold, 25,                       \
  97           "How much garbage a region has to contain before it would be "    \
  98           "taken for collection. This a guideline only, as GC heuristics "  \
  99           "may select the region for collection even if it has little "     \
 100           "garbage. This also affects how much internal fragmentation the " \
 101           "collector accepts. In percents of heap region size.")            \
 102           range(0,100)                                                      \
 103                                                                             \
 104   experimental(uintx, ShenandoahInitFreeThreshold, 70,                      \
 105           "How much heap should be free before some heuristics trigger the "\
 106           "initial (learning) cycles. Affects cycle frequency on startup "  \
 107           "and after drastic state changes, e.g. after degenerated/full "   \
 108           "GC cycles. In percents of total heap size.")                     \
 109           range(0,100)                                                      \
 110                                                                             \
 111   experimental(uintx, ShenandoahMinFreeThreshold, 10,                       \
 112           "How much heap should be free before most heuristics trigger the "\
 113           "collection, even without other triggers. Provides the safety "   \
 114           "margin for many heuristics. In percents of total heap size.")    \
 115           range(0,100)                                                      \
 116                                                                             \
 117   experimental(uintx, ShenandoahAllocationThreshold, 0,                     \
 118           "How many new allocations should happen since the last GC cycle " \
 119           "before some heuristics trigger the collection. In percents of "  \
 120           "total heap size. Set to zero to effectively disable.")           \
 121           range(0,100)                                                      \
 122                                                                             \
 123   experimental(uintx, ShenandoahAllocSpikeFactor, 5,                        \
 124           "How much of heap should some heuristics reserve for absorbing "  \
 125           "the allocation spikes. Larger value wastes more memory in "      \
 126           "non-emergency cases, but provides more safety in emergency "     \
 127           "cases. In percents of total heap size.")                         \
 128           range(0,100)                                                      \
 129                                                                             \
 130   experimental(uintx, ShenandoahLearningSteps, 5,                           \
 131           "The number of cycles some heuristics take to collect in order "  \
 132           "to learn application and GC performance.")                       \
 133           range(0,100)                                                      \
 134                                                                             \
 135   experimental(uintx, ShenandoahImmediateThreshold, 90,                     \
 136           "The cycle may shortcut when enough garbage can be reclaimed "    \
 137           "from the immediate garbage (completely garbage regions). "       \
 138           "In percents of total garbage found. Setting this threshold "     \
 139           "to 100 effectively disables the shortcut.")                      \
 140           range(0,100)                                                      \
 141                                                                             \
 142   experimental(uintx, ShenandoahGuaranteedGCInterval, 5*60*1000,            \
 143           "Many heuristics would guarantee a concurrent GC cycle at "       \
 144           "least with this interval. This is useful when large idle "       \
 145           "intervals are present, where GC can run without stealing "       \
 146           "time from active application. Time is in milliseconds. "         \
 147           "Setting this to 0 disables the feature.")                        \
 148                                                                             \
 149   experimental(bool, ShenandoahAlwaysClearSoftRefs, false,                  \
 150           "Unconditionally clear soft references, instead of using any "    \
 151           "other cleanup policy. This minimizes footprint at expense of"    \
 152           "more soft reference churn in applications.")                     \
 153                                                                             \
 154   experimental(bool, ShenandoahUncommit, true,                              \
 155           "Allow to uncommit memory under unused regions and metadata. "    \
 156           "This optimizes footprint at expense of allocation latency in "   \
 157           "regions that require committing back. Uncommits would be "       \
 158           "disabled by some heuristics, or with static heap size.")         \
 159                                                                             \
 160   experimental(uintx, ShenandoahUncommitDelay, 5*60*1000,                   \
 161           "Uncommit memory for regions that were not used for more than "   \
 162           "this time. First use after that would incur allocation stalls. " \
 163           "Actively used regions would never be uncommitted, because they " \
 164           "do not become unused longer than this delay. Time is in "        \
 165           "milliseconds. Setting this delay to 0 effectively uncommits "    \
 166           "regions almost immediately after they become unused.")           \
 167                                                                             \
 168   experimental(bool, ShenandoahRegionSampling, false,                       \
 169           "Provide heap region sampling data via jvmstat.")                 \
 170                                                                             \
 171   experimental(int, ShenandoahRegionSamplingRate, 40,                       \
 172           "Sampling rate for heap region sampling. In milliseconds between "\
 173           "the samples. Higher values provide more fidelity, at expense "   \
 174           "of more sampling overhead.")                                     \
 175                                                                             \
 176   experimental(uintx, ShenandoahControlIntervalMin, 1,                      \
 177           "The minimum sleep interval for the control loop that drives "    \
 178           "the cycles. Lower values would increase GC responsiveness "      \
 179           "to changing heap conditions, at the expense of higher perf "     \
 180           "overhead. Time is in milliseconds.")                             \
 181                                                                             \
 182   experimental(uintx, ShenandoahControlIntervalMax, 10,                     \
 183           "The maximum sleep interval for control loop that drives "        \
 184           "the cycles. Lower values would increase GC responsiveness "      \
 185           "to changing heap conditions, at the expense of higher perf "     \
 186           "overhead. Time is in milliseconds.")                             \
 187                                                                             \
 188   experimental(uintx, ShenandoahControlIntervalAdjustPeriod, 1000,          \
 189           "The time period for one step in control loop interval "          \
 190           "adjustment. Lower values make adjustments faster, at the "       \
 191           "expense of higher perf overhead. Time is in milliseconds.")      \
 192                                                                             \
 193   experimental(bool, ShenandoahCriticalControlThreadPriority, false,        \
 194           "Run control thread runs at critical scheduling priority.")       \
 195                                                                             \
 196   diagnostic(bool, ShenandoahVerify, false,                                 \
 197           "Enable internal verification. This would catch many GC bugs, "   \
 198           "but it would also stall the collector during the verification, " \
 199           "which prolongs the pauses and might hide other bugs.")           \
 200                                                                             \
 201   diagnostic(intx, ShenandoahVerifyLevel, 4,                                \
 202           "Verification level, higher levels check more, taking more time. "\
 203           "Accepted values are:"                                            \
 204           " 0 = basic heap checks; "                                        \
 205           " 1 = previous level, plus basic region checks; "                 \
 206           " 2 = previous level, plus all roots; "                           \
 207           " 3 = previous level, plus all reachable objects; "               \
 208           " 4 = previous level, plus all marked objects")                   \
 209                                                                             \
 210   diagnostic(bool, ShenandoahElasticTLAB, true,                             \
 211           "Use Elastic TLABs with Shenandoah")                              \
 212                                                                             \
 213   diagnostic(bool, ShenandoahAllowMixedAllocs, true,                        \
 214           "Allow mixing mutator and collector allocations into a single "   \
 215           "region. Some heuristics enable/disable it for their needs")      \
 216                                                                             \
 217   experimental(uintx, ShenandoahEvacReserve, 5,                             \
 218           "How much of heap to reserve for evacuations. Larger values make "\
 219           "GC evacuate more live objects on every cycle, while leaving "    \
 220           "less headroom for application to allocate in. In percents of "   \
 221           "total heap size.")                                               \
 222           range(1,100)                                                      \
 223                                                                             \
 224   experimental(double, ShenandoahEvacWaste, 1.2,                            \
 225           "How much waste evacuations produce within the reserved space. "  \
 226           "Larger values make evacuations more resilient against "          \
 227           "evacuation conflicts, at expense of evacuating less on each "    \
 228           "GC cycle.")                                                      \
 229           range(1.0,100.0)                                                  \
 230                                                                             \
 231   experimental(bool, ShenandoahEvacReserveOverflow, true,                   \
 232           "Allow evacuations to overflow the reserved space. Enabling it "  \
 233           "will make evacuations more resilient when evacuation "           \
 234           "reserve/waste is incorrect, at the risk that application "       \
 235           "runs out of memory too early.")                                  \
 236                                                                             \
 237   experimental(bool, ShenandoahPacing, true,                                \
 238           "Pace application allocations to give GC chance to start "        \
 239           "and complete before allocation failure is reached.")             \
 240                                                                             \
 241   experimental(uintx, ShenandoahPacingMaxDelay, 10,                         \
 242           "Max delay for pacing application allocations. Larger values "    \
 243           "provide more resilience against out of memory, at expense at "   \
 244           "hiding the GC latencies in the allocation path. Time is in "     \
 245           "milliseconds. Setting it to arbitrarily large value makes "      \
 246           "GC effectively stall the threads indefinitely instead of going " \
 247           "to degenerated or Full GC.")                                     \
 248                                                                             \
 249   experimental(uintx, ShenandoahPacingIdleSlack, 2,                         \
 250           "How much of heap counted as non-taxable allocations during idle "\
 251           "phases. Larger value makes the pacing milder when collector is " \
 252           "idle, requiring less rendezvous with control thread. Lower "     \
 253           "value makes the pacing control less responsive to out-of-cycle " \
 254           "allocs. In percent of total heap size.")                         \
 255           range(0, 100)                                                     \
 256                                                                             \
 257   experimental(uintx, ShenandoahPacingCycleSlack, 10,                       \
 258           "How much of free space to take as non-taxable allocations "      \
 259           "the GC cycle. Larger value makes the pacing milder at the "      \
 260           "beginning of the GC cycle. Lower value makes the pacing less "   \
 261           "uniform during the cycle. In percent of free space.")            \
 262           range(0, 100)                                                     \
 263                                                                             \
 264   experimental(double, ShenandoahPacingSurcharge, 1.1,                      \
 265           "Additional pacing tax surcharge to help unclutter the heap. "    \
 266           "Larger values makes the pacing more aggressive. Lower values "   \
 267           "risk GC cycles finish with less memory than were available at "  \
 268           "the beginning of it.")                                           \
 269           range(1.0, 100.0)                                                 \
 270                                                                             \
 271   experimental(uintx, ShenandoahCriticalFreeThreshold, 1,                   \
 272           "How much of the heap needs to be free after recovery cycles, "   \
 273           "either Degenerated or Full GC to be claimed successful. If this "\
 274           "much space is not available, next recovery step would be "       \
 275           "triggered.")                                                     \
 276           range(0, 100)                                                     \
 277                                                                             \
 278   diagnostic(bool, ShenandoahDegeneratedGC, true,                           \
 279           "Enable Degenerated GC as the graceful degradation step. "        \
 280           "Disabling this option leads to degradation to Full GC instead. " \
 281           "When running in passive mode, this can be toggled to measure "   \
 282           "either Degenerated GC or Full GC costs.")                        \
 283                                                                             \
 284   experimental(uintx, ShenandoahFullGCThreshold, 3,                         \
 285           "How many back-to-back Degenerated GCs should happen before "     \
 286           "going to a Full GC.")                                            \
 287                                                                             \
 288   experimental(bool, ShenandoahImplicitGCInvokesConcurrent, false,          \
 289           "Should internally-caused GC requests invoke concurrent cycles, " \
 290           "should they do the stop-the-world (Degenerated / Full GC)? "     \
 291           "Many heuristics automatically enable this. This option is "      \
 292           "similar to global ExplicitGCInvokesConcurrent.")                 \
 293                                                                             \
 294   diagnostic(bool, ShenandoahHumongousMoves, true,                          \
 295           "Allow moving humongous regions. This makes GC more resistant "   \
 296           "to external fragmentation that may otherwise fail other "        \
 297           "humongous allocations, at the expense of higher GC copying "     \
 298           "costs. Currently affects stop-the-world (Full) cycle only.")     \
 299                                                                             \
 300   diagnostic(bool, ShenandoahOOMDuringEvacALot, false,                      \
 301           "Testing: simulate OOM during evacuation.")                       \
 302                                                                             \
 303   diagnostic(bool, ShenandoahAllocFailureALot, false,                       \
 304           "Testing: make lots of artificial allocation failures.")          \
 305                                                                             \
 306   diagnostic(bool, ShenandoahAlwaysPreTouch, false,                         \
 307           "Pre-touch heap memory, overrides global AlwaysPreTouch.")        \
 308                                                                             \
 309   experimental(intx, ShenandoahMarkScanPrefetch, 32,                        \
 310           "How many objects to prefetch ahead when traversing mark bitmaps."\
 311           "Set to 0 to disable prefetching.")                               \
 312           range(0, 256)                                                     \
 313                                                                             \
 314   experimental(uintx, ShenandoahMarkLoopStride, 1000,                       \
 315           "How many items to process during one marking iteration before "  \
 316           "checking for cancellation, yielding, etc. Larger values improve "\
 317           "marking performance at expense of responsiveness.")              \
 318                                                                             \
 319   experimental(uintx, ShenandoahParallelRegionStride, 1024,                 \
 320           "How many regions to process at once during parallel region "     \
 321           "iteration. Affects heaps with lots of regions.")                 \
 322                                                                             \
 323   experimental(size_t, ShenandoahSATBBufferSize, 1 * K,                     \
 324           "Number of entries in an SATB log buffer.")                       \
 325           range(1, max_uintx)                                               \
 326                                                                             \
 327   experimental(uintx, ShenandoahSATBBufferFlushInterval, 100,               \
 328           "Forcefully flush non-empty SATB buffers at this interval. "      \
 329           "Time is in milliseconds.")                                       \
 330                                                                             \
 331   diagnostic(bool, ShenandoahPreclean, true,                                \
 332           "Do concurrent preclean phase before final mark: process "        \
 333           "definitely alive references to avoid dealing with them during "  \
 334           "pause.")                                                         \
 335                                                                             \
 336   experimental(bool, ShenandoahSuspendibleWorkers, false,                   \
 337           "Suspend concurrent GC worker threads at safepoints")             \
 338                                                                             \
 339   diagnostic(bool, ShenandoahSATBBarrier, true,                             \
 340           "Turn on/off SATB barriers in Shenandoah")                        \
 341                                                                             \
 342   diagnostic(bool, ShenandoahStoreValEnqueueBarrier, false,                 \
 343           "Turn on/off enqueuing of oops for storeval barriers")            \
 344                                                                             \
 345   diagnostic(bool, ShenandoahCASBarrier, true,                              \
 346           "Turn on/off CAS barriers in Shenandoah")                         \
 347                                                                             \
 348   diagnostic(bool, ShenandoahCloneBarrier, true,                            \
 349           "Turn on/off clone barriers in Shenandoah")                       \
 350                                                                             \
 351   diagnostic(bool, ShenandoahLoadRefBarrier, true,                          \
 352           "Turn on/off load-reference barriers in Shenandoah")              \
 353                                                                             \
 354   diagnostic(bool, ShenandoahConcurrentScanCodeRoots, true,                 \
 355           "Scan code roots concurrently, instead of during a pause")        \
 356                                                                             \
 357   diagnostic(uintx, ShenandoahCodeRootsStyle, 2,                            \
 358           "Use this style to scan the code cache roots:"                    \
 359           " 0 - sequential iterator;"                                       \
 360           " 1 - parallel iterator;"                                         \
 361           " 2 - parallel iterator with cset filters;")                      \
 362                                                                             \
 363   diagnostic(bool, ShenandoahOptimizeStaticFinals, true,                    \
 364           "Optimize barriers on static final fields. "                      \
 365           "Turn it off for maximum compatibility with reflection or JNI "   \
 366           "code that manipulates final fields.")                            \
 367                                                                             \
 368   develop(bool, ShenandoahVerifyOptoBarriers, false,                        \
 369           "Verify no missing barriers in C2.")                              \
 370                                                                             \
 371   diagnostic(bool, ShenandoahLoopOptsAfterExpansion, true,                  \
 372           "Attempt more loop opts after barrier expansion.")                \
 373                                                                             \
 374   diagnostic(bool, ShenandoahSelfFixing, true,                              \
 375           "Fix references with load reference barrier. Disabling this "     \
 376           "might degrade performance.")                                     \
 377 












































































































































































































































































































































 378 
 379 #endif // SHARE_GC_SHENANDOAH_SHENANDOAH_GLOBALS_HPP


   9  *
  10  * This code is distributed in the hope that it will be useful, but WITHOUT
  11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  13  * version 2 for more details (a copy is included in the LICENSE file that
  14  * accompanied this code).
  15  *
  16  * You should have received a copy of the GNU General Public License version
  17  * 2 along with this work; if not, write to the Free Software Foundation,
  18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  19  *
  20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  21  * or visit www.oracle.com if you need additional information or have any
  22  * questions.
  23  *
  24  */
  25 
  26 #ifndef SHARE_GC_SHENANDOAH_SHENANDOAH_GLOBALS_HPP
  27 #define SHARE_GC_SHENANDOAH_SHENANDOAH_GLOBALS_HPP
  28 
  29 #include "utilities/macros.hpp"
  30 #if INCLUDE_SHENANDOAHGC
  31 #include "runtime/flags/jvmFlag.hpp"
  32 PRODUCT_FLAG(size_t,   ShenandoahRegionSize, 0, JVMFlag::EXPERIMENTAL,
  33                        "Static heap region size. Set zero to enable automatic sizing.");























































































































































































































































































































































  34 
  35 PRODUCT_FLAG(size_t,   ShenandoahTargetNumRegions, 2048, JVMFlag::EXPERIMENTAL,
  36                        "With automatic region sizing, this is the approximate number "
  37                        "of regions that would be used, within min/max region size "
  38                        "limits.");
  39 
  40 PRODUCT_FLAG(size_t,   ShenandoahMinRegionSize, 256 * K, JVMFlag::EXPERIMENTAL,
  41                        "With automatic region sizing, the regions would be at least "
  42                        "this large.");
  43 
  44 PRODUCT_FLAG(size_t,   ShenandoahMaxRegionSize, 32 * M, JVMFlag::EXPERIMENTAL,
  45                        "With automatic region sizing, the regions would be at most "
  46                        "this large.");
  47 
  48 PRODUCT_FLAG(intx,     ShenandoahHumongousThreshold, 100, JVMFlag::EXPERIMENTAL | JVMFlag::RANGE,
  49                        "Humongous objects are allocated in separate regions. "
  50                        "This setting defines how large the object should be to be "
  51                        "deemed humongous. Value is in  percents of heap region size. "
  52                        "This also caps the maximum TLAB size.");
  53    FLAG_RANGE(         ShenandoahHumongousThreshold, 1, 100);
  54 
  55 PRODUCT_FLAG(ccstr,    ShenandoahGCMode, "normal", JVMFlag::EXPERIMENTAL,
  56                        "GC mode to use.  Among other things, this defines which "
  57                        "barriers are in in use. Possible values are:"
  58                        " normal - default concurrent GC (three pass mark-evac-update);"
  59                        " passive - stop the world GC only (either degenerated or full)");
  60 
  61 PRODUCT_FLAG(ccstr,    ShenandoahGCHeuristics, "adaptive", JVMFlag::EXPERIMENTAL,
  62                        "GC heuristics to use. This fine-tunes the GC mode selected, "
  63                        "by choosing when to start the GC, how much to process on each "
  64                        "cycle, and what other features to automatically enable. "
  65                        "Possible values are:"
  66                        " adaptive - adapt to maintain the given amount of free heap "
  67                        "at all times, even during the GC cycle;"
  68                        " static -  trigger GC when free heap falls below the threshold;"
  69                        " aggressive - run GC continuously, try to evacuate everything;"
  70                        " compact - run GC more frequently and with deeper targets to "
  71                        "free up more memory.");
  72 
  73 PRODUCT_FLAG(uintx,    ShenandoahRefProcFrequency, 5, JVMFlag::EXPERIMENTAL,
  74                        "Process process weak (soft, phantom, finalizers) references "
  75                        "every Nth cycle. Normally affects concurrent GC cycles only, "
  76                        "as degenerated and full GCs would try to process references "
  77                        "regardless. Set to zero to disable reference processing "
  78                        "completely.");
  79 
  80 PRODUCT_FLAG(uintx,    ShenandoahUnloadClassesFrequency, 1, JVMFlag::EXPERIMENTAL,
  81                        "Unload the classes every Nth cycle. Normally affects concurrent "
  82                        "GC cycles, as degenerated and full GCs would try to unload "
  83                        "classes regardless. Set to zero to disable class unloading.");
  84 
  85 PRODUCT_FLAG(uintx,    ShenandoahGarbageThreshold, 25, JVMFlag::EXPERIMENTAL | JVMFlag::RANGE,
  86                        "How much garbage a region has to contain before it would be "
  87                        "taken for collection. This a guideline only, as GC heuristics "
  88                        "may select the region for collection even if it has little "
  89                        "garbage. This also affects how much internal fragmentation the "
  90                        "collector accepts. In percents of heap region size.");
  91    FLAG_RANGE(         ShenandoahGarbageThreshold, 0,100);
  92 
  93 PRODUCT_FLAG(uintx,    ShenandoahInitFreeThreshold, 70, JVMFlag::EXPERIMENTAL | JVMFlag::RANGE,
  94                        "How much heap should be free before some heuristics trigger the "
  95                        "initial (learning) cycles. Affects cycle frequency on startup "
  96                        "and after drastic state changes, e.g. after degenerated/full "
  97                        "GC cycles. In percents of total heap size.");
  98    FLAG_RANGE(         ShenandoahInitFreeThreshold, 0,100);
  99 
 100 PRODUCT_FLAG(uintx,    ShenandoahMinFreeThreshold, 10, JVMFlag::EXPERIMENTAL | JVMFlag::RANGE,
 101                        "How much heap should be free before most heuristics trigger the "
 102                        "collection, even without other triggers. Provides the safety "
 103                        "margin for many heuristics. In percents of total heap size.");
 104    FLAG_RANGE(         ShenandoahMinFreeThreshold, 0,100);
 105 
 106 PRODUCT_FLAG(uintx,    ShenandoahAllocationThreshold, 0, JVMFlag::EXPERIMENTAL | JVMFlag::RANGE,
 107                        "How many new allocations should happen since the last GC cycle "
 108                        "before some heuristics trigger the collection. In percents of "
 109                        "total heap size. Set to zero to effectively disable.");
 110    FLAG_RANGE(         ShenandoahAllocationThreshold, 0,100);
 111 
 112 PRODUCT_FLAG(uintx,    ShenandoahAllocSpikeFactor, 5, JVMFlag::EXPERIMENTAL | JVMFlag::RANGE,
 113                        "How much of heap should some heuristics reserve for absorbing "
 114                        "the allocation spikes. Larger value wastes more memory in "
 115                        "non-emergency cases, but provides more safety in emergency "
 116                        "cases. In percents of total heap size.");
 117    FLAG_RANGE(         ShenandoahAllocSpikeFactor, 0,100);
 118 
 119 PRODUCT_FLAG(uintx,    ShenandoahLearningSteps, 5, JVMFlag::EXPERIMENTAL | JVMFlag::RANGE,
 120                        "The number of cycles some heuristics take to collect in order "
 121                        "to learn application and GC performance.");
 122    FLAG_RANGE(         ShenandoahLearningSteps, 0,100);
 123 
 124 PRODUCT_FLAG(uintx,    ShenandoahImmediateThreshold, 90, JVMFlag::EXPERIMENTAL | JVMFlag::RANGE,
 125                        "The cycle may shortcut when enough garbage can be reclaimed "
 126                        "from the immediate garbage (completely garbage regions). "
 127                        "In percents of total garbage found. Setting this threshold "
 128                        "to 100 effectively disables the shortcut.");
 129    FLAG_RANGE(         ShenandoahImmediateThreshold, 0,100);
 130 
 131 PRODUCT_FLAG(uintx,    ShenandoahGuaranteedGCInterval, 5*60*1000, JVMFlag::EXPERIMENTAL,
 132                        "Many heuristics would guarantee a concurrent GC cycle at "
 133                        "least with this interval. This is useful when large idle "
 134                        "intervals are present, where GC can run without stealing "
 135                        "time from active application. Time is in milliseconds. "
 136                        "Setting this to 0 disables the feature.");
 137 
 138 PRODUCT_FLAG(bool,     ShenandoahAlwaysClearSoftRefs, false, JVMFlag::EXPERIMENTAL,
 139                        "Unconditionally clear soft references, instead of using any "
 140                        "other cleanup policy. This minimizes footprint at expense of"
 141                        "more soft reference churn in applications.");
 142 
 143 PRODUCT_FLAG(bool,     ShenandoahUncommit, true, JVMFlag::EXPERIMENTAL,
 144                        "Allow to uncommit memory under unused regions and metadata. "
 145                        "This optimizes footprint at expense of allocation latency in "
 146                        "regions that require committing back. Uncommits would be "
 147                        "disabled by some heuristics, or with static heap size.");
 148 
 149 PRODUCT_FLAG(uintx,    ShenandoahUncommitDelay, 5*60*1000, JVMFlag::EXPERIMENTAL,
 150                        "Uncommit memory for regions that were not used for more than "
 151                        "this time. First use after that would incur allocation stalls. "
 152                        "Actively used regions would never be uncommitted, because they "
 153                        "do not become unused longer than this delay. Time is in "
 154                        "milliseconds. Setting this delay to 0 effectively uncommits "
 155                        "regions almost immediately after they become unused.");
 156 
 157 PRODUCT_FLAG(bool,     ShenandoahRegionSampling, false, JVMFlag::EXPERIMENTAL,
 158                        "Provide heap region sampling data via jvmstat.");
 159 
 160 PRODUCT_FLAG(int,      ShenandoahRegionSamplingRate, 40, JVMFlag::EXPERIMENTAL,
 161                        "Sampling rate for heap region sampling. In milliseconds between "
 162                        "the samples. Higher values provide more fidelity, at expense "
 163                        "of more sampling overhead.");
 164 
 165 PRODUCT_FLAG(uintx,    ShenandoahControlIntervalMin, 1, JVMFlag::EXPERIMENTAL,
 166                        "The minimum sleep interval for the control loop that drives "
 167                        "the cycles. Lower values would increase GC responsiveness "
 168                        "to changing heap conditions, at the expense of higher perf "
 169                        "overhead. Time is in milliseconds.");
 170 
 171 PRODUCT_FLAG(uintx,    ShenandoahControlIntervalMax, 10, JVMFlag::EXPERIMENTAL,
 172                        "The maximum sleep interval for control loop that drives "
 173                        "the cycles. Lower values would increase GC responsiveness "
 174                        "to changing heap conditions, at the expense of higher perf "
 175                        "overhead. Time is in milliseconds.");
 176 
 177 PRODUCT_FLAG(uintx,    ShenandoahControlIntervalAdjustPeriod, 1000, JVMFlag::EXPERIMENTAL,
 178                        "The time period for one step in control loop interval "
 179                        "adjustment. Lower values make adjustments faster, at the "
 180                        "expense of higher perf overhead. Time is in milliseconds.");
 181 
 182 PRODUCT_FLAG(bool,     ShenandoahCriticalControlThreadPriority, false, JVMFlag::EXPERIMENTAL,
 183                        "Run control thread runs at critical scheduling priority.");
 184 
 185 PRODUCT_FLAG(bool,     ShenandoahVerify, false, JVMFlag::DIAGNOSTIC,
 186                        "Enable internal verification. This would catch many GC bugs, "
 187                        "but it would also stall the collector during the verification, "
 188                        "which prolongs the pauses and might hide other bugs.");
 189 
 190 PRODUCT_FLAG(intx,     ShenandoahVerifyLevel, 4, JVMFlag::DIAGNOSTIC,
 191                        "Verification level, higher levels check more, taking more time. "
 192                        "Accepted values are:"
 193                        " 0 = basic heap checks; "
 194                        " 1 = previous level, plus basic region checks; "
 195                        " 2 = previous level, plus all roots; "
 196                        " 3 = previous level, plus all reachable objects; "
 197                        " 4 = previous level, plus all marked objects");
 198 
 199 PRODUCT_FLAG(bool,     ShenandoahElasticTLAB, true, JVMFlag::DIAGNOSTIC,
 200                        "Use Elastic TLABs with Shenandoah");
 201 
 202 PRODUCT_FLAG(bool,     ShenandoahAllowMixedAllocs, true, JVMFlag::DIAGNOSTIC,
 203                        "Allow mixing mutator and collector allocations into a single "
 204                        "region. Some heuristics enable/disable it for their needs");
 205 
 206 PRODUCT_FLAG(uintx,    ShenandoahEvacReserve, 5, JVMFlag::EXPERIMENTAL | JVMFlag::RANGE,
 207                        "How much of heap to reserve for evacuations. Larger values make "
 208                        "GC evacuate more live objects on every cycle, while leaving "
 209                        "less headroom for application to allocate in. In percents of "
 210                        "total heap size.");
 211    FLAG_RANGE(         ShenandoahEvacReserve, 1,100);
 212 
 213 PRODUCT_FLAG(double,   ShenandoahEvacWaste, 1.2, JVMFlag::EXPERIMENTAL | JVMFlag::RANGE,
 214                        "How much waste evacuations produce within the reserved space. "
 215                        "Larger values make evacuations more resilient against "
 216                        "evacuation conflicts, at expense of evacuating less on each "
 217                        "GC cycle.");
 218    FLAG_RANGE(         ShenandoahEvacWaste, 1.0,100.0);
 219 
 220 PRODUCT_FLAG(bool,     ShenandoahEvacReserveOverflow, true, JVMFlag::EXPERIMENTAL,
 221                        "Allow evacuations to overflow the reserved space. Enabling it "
 222                        "will make evacuations more resilient when evacuation "
 223                        "reserve/waste is incorrect, at the risk that application "
 224                        "runs out of memory too early.");
 225 
 226 PRODUCT_FLAG(bool,     ShenandoahPacing, true, JVMFlag::EXPERIMENTAL,
 227                        "Pace application allocations to give GC chance to start "
 228                        "and complete before allocation failure is reached.");
 229 
 230 PRODUCT_FLAG(uintx,    ShenandoahPacingMaxDelay, 10, JVMFlag::EXPERIMENTAL,
 231                        "Max delay for pacing application allocations. Larger values "
 232                        "provide more resilience against out of memory, at expense at "
 233                        "hiding the GC latencies in the allocation path. Time is in "
 234                        "milliseconds. Setting it to arbitrarily large value makes "
 235                        "GC effectively stall the threads indefinitely instead of going "
 236                        "to degenerated or Full GC.");
 237 
 238 PRODUCT_FLAG(uintx,    ShenandoahPacingIdleSlack, 2, JVMFlag::EXPERIMENTAL | JVMFlag::RANGE,
 239                        "How much of heap counted as non-taxable allocations during idle "
 240                        "phases. Larger value makes the pacing milder when collector is "
 241                        "idle, requiring less rendezvous with control thread. Lower "
 242                        "value makes the pacing control less responsive to out-of-cycle "
 243                        "allocs. In percent of total heap size.");
 244    FLAG_RANGE(         ShenandoahPacingIdleSlack, 0, 100);
 245 
 246 PRODUCT_FLAG(uintx,    ShenandoahPacingCycleSlack, 10, JVMFlag::EXPERIMENTAL | JVMFlag::RANGE,
 247                        "How much of free space to take as non-taxable allocations "
 248                        "the GC cycle. Larger value makes the pacing milder at the "
 249                        "beginning of the GC cycle. Lower value makes the pacing less "
 250                        "uniform during the cycle. In percent of free space.");
 251    FLAG_RANGE(         ShenandoahPacingCycleSlack, 0, 100);
 252 
 253 PRODUCT_FLAG(double,   ShenandoahPacingSurcharge, 1.1, JVMFlag::EXPERIMENTAL | JVMFlag::RANGE,
 254                        "Additional pacing tax surcharge to help unclutter the heap. "
 255                        "Larger values makes the pacing more aggressive. Lower values "
 256                        "risk GC cycles finish with less memory than were available at "
 257                        "the beginning of it.");
 258    FLAG_RANGE(         ShenandoahPacingSurcharge, 1.0, 100.0);
 259 
 260 PRODUCT_FLAG(uintx,    ShenandoahCriticalFreeThreshold, 1, JVMFlag::EXPERIMENTAL | JVMFlag::RANGE,
 261                        "How much of the heap needs to be free after recovery cycles, "
 262                        "either Degenerated or Full GC to be claimed successful. If this "
 263                        "much space is not available, next recovery step would be "
 264                        "triggered.");
 265    FLAG_RANGE(         ShenandoahCriticalFreeThreshold, 0, 100);
 266 
 267 PRODUCT_FLAG(bool,     ShenandoahDegeneratedGC, true, JVMFlag::DIAGNOSTIC,
 268                        "Enable Degenerated GC as the graceful degradation step. "
 269                        "Disabling this option leads to degradation to Full GC instead. "
 270                        "When running in passive mode, this can be toggled to measure "
 271                        "either Degenerated GC or Full GC costs.");
 272 
 273 PRODUCT_FLAG(uintx,    ShenandoahFullGCThreshold, 3, JVMFlag::EXPERIMENTAL,
 274                        "How many back-to-back Degenerated GCs should happen before "
 275                        "going to a Full GC.");
 276 
 277 PRODUCT_FLAG(bool,     ShenandoahImplicitGCInvokesConcurrent, false, JVMFlag::EXPERIMENTAL,
 278                        "Should internally-caused GC requests invoke concurrent cycles, "
 279                        "should they do the stop-the-world (Degenerated / Full GC)? "
 280                        "Many heuristics automatically enable this. This option is "
 281                        "similar to global ExplicitGCInvokesConcurrent.");
 282 
 283 PRODUCT_FLAG(bool,     ShenandoahHumongousMoves, true, JVMFlag::DIAGNOSTIC,
 284                        "Allow moving humongous regions. This makes GC more resistant "
 285                        "to external fragmentation that may otherwise fail other "
 286                        "humongous allocations, at the expense of higher GC copying "
 287                        "costs. Currently affects stop-the-world (Full) cycle only.");
 288 
 289 PRODUCT_FLAG(bool,     ShenandoahOOMDuringEvacALot, false, JVMFlag::DIAGNOSTIC,
 290                        "Testing: simulate OOM during evacuation.");
 291 
 292 PRODUCT_FLAG(bool,     ShenandoahAllocFailureALot, false, JVMFlag::DIAGNOSTIC,
 293                        "Testing: make lots of artificial allocation failures.");
 294 
 295 PRODUCT_FLAG(bool,     ShenandoahAlwaysPreTouch, false, JVMFlag::DIAGNOSTIC,
 296                        "Pre-touch heap memory, overrides global AlwaysPreTouch.");
 297 
 298 PRODUCT_FLAG(intx,     ShenandoahMarkScanPrefetch, 32, JVMFlag::EXPERIMENTAL | JVMFlag::RANGE,
 299                        "How many objects to prefetch ahead when traversing mark bitmaps."
 300                        "Set to 0 to disable prefetching.");
 301    FLAG_RANGE(         ShenandoahMarkScanPrefetch, 0, 256);
 302 
 303 PRODUCT_FLAG(uintx,    ShenandoahMarkLoopStride, 1000, JVMFlag::EXPERIMENTAL,
 304                        "How many items to process during one marking iteration before "
 305                        "checking for cancellation, yielding, etc. Larger values improve "
 306                        "marking performance at expense of responsiveness.");
 307 
 308 PRODUCT_FLAG(uintx,    ShenandoahParallelRegionStride, 1024, JVMFlag::EXPERIMENTAL,
 309                        "How many regions to process at once during parallel region "
 310                        "iteration. Affects heaps with lots of regions.");
 311 
 312 PRODUCT_FLAG(size_t,   ShenandoahSATBBufferSize, 1 * K, JVMFlag::EXPERIMENTAL | JVMFlag::RANGE,
 313                        "Number of entries in an SATB log buffer.");
 314    FLAG_RANGE(         ShenandoahSATBBufferSize, 1, max_uintx);
 315 
 316 PRODUCT_FLAG(uintx,    ShenandoahSATBBufferFlushInterval, 100, JVMFlag::EXPERIMENTAL,
 317                        "Forcefully flush non-empty SATB buffers at this interval. "
 318                        "Time is in milliseconds.");
 319 
 320 PRODUCT_FLAG(bool,     ShenandoahPreclean, true, JVMFlag::DIAGNOSTIC,
 321                        "Do concurrent preclean phase before final mark: process "
 322                        "definitely alive references to avoid dealing with them during "
 323                        "pause.");
 324 
 325 PRODUCT_FLAG(bool,     ShenandoahSuspendibleWorkers, false, JVMFlag::EXPERIMENTAL,
 326                        "Suspend concurrent GC worker threads at safepoints");
 327 
 328 PRODUCT_FLAG(bool,     ShenandoahSATBBarrier, true, JVMFlag::DIAGNOSTIC,
 329                        "Turn on/off SATB barriers in Shenandoah");
 330 
 331 PRODUCT_FLAG(bool,     ShenandoahStoreValEnqueueBarrier, false, JVMFlag::DIAGNOSTIC,
 332                        "Turn on/off enqueuing of oops for storeval barriers");
 333 
 334 PRODUCT_FLAG(bool,     ShenandoahCASBarrier, true, JVMFlag::DIAGNOSTIC,
 335                        "Turn on/off CAS barriers in Shenandoah");
 336 
 337 PRODUCT_FLAG(bool,     ShenandoahCloneBarrier, true, JVMFlag::DIAGNOSTIC,
 338                        "Turn on/off clone barriers in Shenandoah");
 339 
 340 PRODUCT_FLAG(bool,     ShenandoahLoadRefBarrier, true, JVMFlag::DIAGNOSTIC,
 341                        "Turn on/off load-reference barriers in Shenandoah");
 342 
 343 PRODUCT_FLAG(bool,     ShenandoahConcurrentScanCodeRoots, true, JVMFlag::DIAGNOSTIC,
 344                        "Scan code roots concurrently, instead of during a pause");
 345 
 346 PRODUCT_FLAG(uintx,    ShenandoahCodeRootsStyle, 2, JVMFlag::DIAGNOSTIC,
 347                        "Use this style to scan the code cache roots:"
 348                        " 0 - sequential iterator;"
 349                        " 1 - parallel iterator;"
 350                        " 2 - parallel iterator with cset filters;");
 351 
 352 PRODUCT_FLAG(bool,     ShenandoahOptimizeStaticFinals, true, JVMFlag::DIAGNOSTIC,
 353                        "Optimize barriers on static final fields. "
 354                        "Turn it off for maximum compatibility with reflection or JNI "
 355                        "code that manipulates final fields.");
 356 
 357 DEVELOP_FLAG(bool,     ShenandoahVerifyOptoBarriers, false, JVMFlag::DEFAULT,
 358                        "Verify no missing barriers in C2.");
 359 
 360 PRODUCT_FLAG(bool,     ShenandoahLoopOptsAfterExpansion, true, JVMFlag::DIAGNOSTIC,
 361                        "Attempt more loop opts after barrier expansion.");
 362 
 363 PRODUCT_FLAG(bool,     ShenandoahSelfFixing, true, JVMFlag::DIAGNOSTIC,
 364                        "Fix references with load reference barrier. Disabling this "
 365                        "might degrade performance.");
 366 #endif // INCLUDE_SHENANDOAHGC
 367 
 368 #endif // SHARE_GC_SHENANDOAH_SHENANDOAH_GLOBALS_HPP
< prev index next >