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