1 /*
  2  * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
  3  * Copyright (c) 2017, 2018, Red Hat, Inc. All rights reserved.
  4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  5  *
  6  * This code is free software; you can redistribute it and/or modify it
  7  * under the terms of the GNU General Public License version 2 only, as
  8  * published by the Free Software Foundation.
  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_EPSILON_EPSILON_GLOBALS_HPP
 27 #define SHARE_GC_EPSILON_EPSILON_GLOBALS_HPP
 28 
 29 #include "runtime/globals_shared.hpp"
 30 
 31 //
 32 // Defines all globals flags used by the Epsilon GC.
 33 //
 34 
 35 #define GC_EPSILON_FLAGS(develop,                                           \
 36                          develop_pd,                                        \
 37                          product,                                           \
 38                          product_pd,                                        \
 39                          notproduct,                                        \
 40                          range,                                             \
 41                          constraint)                                        \
 42                                                                             \
 43   product(size_t, EpsilonPrintHeapSteps, 20, EXPERIMENTAL,                  \
 44           "Print heap occupancy stats with this number of steps. "          \
 45           "0 turns the printing off.")                                      \
 46           range(0, max_intx)                                                \
 47                                                                             \
 48   product(size_t, EpsilonUpdateCountersStep, 1 * M, EXPERIMENTAL,           \
 49           "Update heap occupancy counters after allocating this much "      \
 50           "memory. Higher values would make allocations faster at "         \
 51           "the expense of lower resolution in heap counters.")              \
 52           range(1, max_intx)                                                \
 53                                                                             \
 54   product(size_t, EpsilonMaxTLABSize, 4 * M, EXPERIMENTAL,                  \
 55           "Max TLAB size to use with Epsilon GC. Larger value improves "    \
 56           "performance at the expense of per-thread memory waste. This "    \
 57           "asks TLAB machinery to cap TLAB sizes at this value.")           \
 58           range(1, max_intx)                                                \
 59                                                                             \
 60   product(bool, EpsilonElasticTLAB, true, EXPERIMENTAL,                     \
 61           "Use elastic policy to manage TLAB sizes. This conserves memory " \
 62           "for non-actively allocating threads, even when they request "    \
 63           "large TLABs for themselves. Active threads would experience "    \
 64           "smaller TLABs until policy catches up.")                         \
 65                                                                             \
 66   product(bool, EpsilonElasticTLABDecay, true, EXPERIMENTAL,                \
 67           "Use timed decays to shrink TLAB sizes. This conserves memory "   \
 68           "for the threads that allocate in bursts of different sizes, "    \
 69           "for example the small/rare allocations coming after the initial "\
 70           "large burst.")                                                   \
 71                                                                             \
 72   product(double, EpsilonTLABElasticity, 1.1, EXPERIMENTAL,                 \
 73           "Multiplier to use when deciding on next TLAB size. Larger value "\
 74           "improves performance at the expense of per-thread memory waste. "\
 75           "Lower value improves memory footprint, but penalizes actively "  \
 76           "allocating threads.")                                            \
 77           range(1.0, DBL_MAX)                                               \
 78                                                                             \
 79   product(size_t, EpsilonTLABDecayTime, 1000, EXPERIMENTAL,                 \
 80           "TLAB sizing policy decays to initial size after thread had not " \
 81           "allocated for this long. Time is in milliseconds. Lower value "  \
 82           "improves memory footprint, but penalizes actively allocating "   \
 83           "threads.")                                                       \
 84           range(1, max_intx)                                                \
 85                                                                             \
 86   product(size_t, EpsilonMinHeapExpand, 128 * M, EXPERIMENTAL,              \
 87           "Min expansion step for heap. Larger value improves performance " \
 88           "at the potential expense of memory waste.")                      \
 89           range(1, max_intx)                                                \
 90                                                                             \
 91   product(bool, EpsilonSlidingGC, false, EXPERIMENTAL,                      \
 92           "Actually does sliding mark-compact GC.")                         \
 93                                                                             \
 94   product(bool, EpsilonImplicitGC, true, EXPERIMENTAL,                      \
 95           "Does GC on implicit GC requests, e.g. for allocation failure.")  \
 96                                                                             \
 97   product(bool, EpsilonUncommit, false, EXPERIMENTAL,                       \
 98           "Uncommits all unneeded memory after GC.")                        \
 99                                                                             \
100   product(bool, EpsilonVerify, false, EXPERIMENTAL,                         \
101           "Does the additional GC verification step.")                      \
102                                                                             \
103 
104 // end of GC_EPSILON_FLAGS
105 
106 #endif // SHARE_GC_EPSILON_EPSILON_GLOBALS_HPP