1 /*
 2  * Copyright (c) 2020, 2024, 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                          range,                                             \
40                          constraint)                                        \
41                                                                             \
42   product(size_t, EpsilonPrintHeapSteps, 20, EXPERIMENTAL,                  \
43           "Print heap occupancy stats with this number of steps. "          \
44           "0 turns the printing off.")                                      \
45           range(0, max_intx)                                                \
46                                                                             \
47   product(size_t, EpsilonUpdateCountersStep, 1 * M, EXPERIMENTAL,           \
48           "Update heap occupancy counters after allocating this much "      \
49           "memory. Higher values would make allocations faster at "         \
50           "the expense of lower resolution in heap counters.")              \
51           range(1, max_intx)                                                \
52                                                                             \
53   product(size_t, EpsilonMaxTLABSize, 4 * M, EXPERIMENTAL,                  \
54           "Max TLAB size to use with Epsilon GC. Larger value improves "    \
55           "performance at the expense of per-thread memory waste. This "    \
56           "asks TLAB machinery to cap TLAB sizes at this value.")           \
57           range(1, max_intx)                                                \
58                                                                             \
59   product(bool, EpsilonElasticTLAB, true, EXPERIMENTAL,                     \
60           "Use elastic policy to manage TLAB sizes. This conserves memory " \
61           "for non-actively allocating threads, even when they request "    \
62           "large TLABs for themselves. Active threads would experience "    \
63           "smaller TLABs until policy catches up.")                         \
64                                                                             \
65   product(bool, EpsilonElasticTLABDecay, true, EXPERIMENTAL,                \
66           "Use timed decays to shrink TLAB sizes. This conserves memory "   \
67           "for the threads that allocate in bursts of different sizes, "    \
68           "for example the small/rare allocations coming after the initial "\
69           "large burst.")                                                   \
70                                                                             \
71   product(double, EpsilonTLABElasticity, 1.1, EXPERIMENTAL,                 \
72           "Multiplier to use when deciding on next TLAB size. Larger value "\
73           "improves performance at the expense of per-thread memory waste. "\
74           "Lower value improves memory footprint, but penalizes actively "  \
75           "allocating threads.")                                            \
76           range(1.0, DBL_MAX)                                               \
77                                                                             \
78   product(size_t, EpsilonTLABDecayTime, 1000, EXPERIMENTAL,                 \
79           "TLAB sizing policy decays to initial size after thread had not " \
80           "allocated for this long. Time is in milliseconds. Lower value "  \
81           "improves memory footprint, but penalizes actively allocating "   \
82           "threads.")                                                       \
83           range(1, max_intx)                                                \
84                                                                             \
85   product(size_t, EpsilonMinHeapExpand, 128 * M, EXPERIMENTAL,              \
86           "Min expansion step for heap. Larger value improves performance " \
87           "at the potential expense of memory waste.")                      \
88           range(1, max_intx)
89 
90 // end of GC_EPSILON_FLAGS
91 
92 #endif // SHARE_GC_EPSILON_EPSILON_GLOBALS_HPP