1 /*
   2  * Copyright (c) 2015, 2019, 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_GC_SHARED_JVMFLAGCONSTRAINTSGC_HPP
  26 #define SHARE_GC_SHARED_JVMFLAGCONSTRAINTSGC_HPP
  27 
  28 #include "utilities/globalDefinitions.hpp"
  29 #include "utilities/macros.hpp"
  30 #if INCLUDE_CMSGC
  31 #include "gc/cms/jvmFlagConstraintsCMS.hpp"
  32 #endif
  33 #if INCLUDE_G1GC
  34 #include "gc/g1/jvmFlagConstraintsG1.hpp"
  35 #endif
  36 #if INCLUDE_PARALLELGC
  37 #include "gc/parallel/jvmFlagConstraintsParallel.hpp"
  38 #endif
  39 
  40 /*
  41  * Here we have GC arguments constraints functions, which are called automatically
  42  * whenever flag's value changes. If the constraint fails the function should return
  43  * an appropriate error value.
  44  */
  45 
  46 JVMFlag::Error ParallelGCThreadsConstraintFunc(uint value, bool verbose);
  47 JVMFlag::Error ConcGCThreadsConstraintFunc(uint value, bool verbose);
  48 JVMFlag::Error YoungPLABSizeConstraintFunc(size_t value, bool verbose);
  49 JVMFlag::Error OldPLABSizeConstraintFunc(size_t value, bool verbose);
  50 JVMFlag::Error MinHeapFreeRatioConstraintFunc(uintx value, bool verbose);
  51 JVMFlag::Error MaxHeapFreeRatioConstraintFunc(uintx value, bool verbose);
  52 JVMFlag::Error SoftRefLRUPolicyMSPerMBConstraintFunc(intx value, bool verbose);
  53 JVMFlag::Error MarkStackSizeConstraintFunc(size_t value, bool verbose);
  54 JVMFlag::Error MinMetaspaceFreeRatioConstraintFunc(uintx value, bool verbose);
  55 JVMFlag::Error MaxMetaspaceFreeRatioConstraintFunc(uintx value, bool verbose);
  56 JVMFlag::Error InitialTenuringThresholdConstraintFunc(uintx value, bool verbose);
  57 JVMFlag::Error MaxTenuringThresholdConstraintFunc(uintx value, bool verbose);
  58 
  59 JVMFlag::Error MaxGCPauseMillisConstraintFunc(uintx value, bool verbose);
  60 JVMFlag::Error GCPauseIntervalMillisConstraintFunc(uintx value, bool verbose);
  61 JVMFlag::Error InitialBootClassLoaderMetaspaceSizeConstraintFunc(size_t value, bool verbose);
  62 JVMFlag::Error InitialHeapSizeConstraintFunc(size_t value, bool verbose);
  63 JVMFlag::Error MaxHeapSizeConstraintFunc(size_t value, bool verbose);
  64 JVMFlag::Error HeapBaseMinAddressConstraintFunc(size_t value, bool verbose);
  65 JVMFlag::Error NewSizeConstraintFunc(size_t value, bool verbose);
  66 JVMFlag::Error MinTLABSizeConstraintFunc(size_t value, bool verbose);
  67 JVMFlag::Error TLABSizeConstraintFunc(size_t value, bool verbose);
  68 JVMFlag::Error TLABWasteIncrementConstraintFunc(uintx value, bool verbose);
  69 JVMFlag::Error SurvivorRatioConstraintFunc(uintx value, bool verbose);
  70 JVMFlag::Error MetaspaceSizeConstraintFunc(size_t value, bool verbose);
  71 JVMFlag::Error MaxMetaspaceSizeConstraintFunc(size_t value, bool verbose);
  72 JVMFlag::Error SurvivorAlignmentInBytesConstraintFunc(intx value, bool verbose);
  73 
  74 // Internal
  75 JVMFlag::Error MaxPLABSizeBounds(const char* name, size_t value, bool verbose);
  76 
  77 #endif // SHARE_GC_SHARED_JVMFLAGCONSTRAINTSGC_HPP