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
46JVMFlag::Error ParallelGCThreadsConstraintFunc(uint value, bool verbose);
47JVMFlag::Error ConcGCThreadsConstraintFunc(uint value, bool verbose);
48JVMFlag::Error YoungPLABSizeConstraintFunc(size_t value, bool verbose);
49JVMFlag::Error OldPLABSizeConstraintFunc(size_t value, bool verbose);
50JVMFlag::Error MinHeapFreeRatioConstraintFunc(uintx value, bool verbose);
51JVMFlag::Error MaxHeapFreeRatioConstraintFunc(uintx value, bool verbose);
52JVMFlag::Error SoftRefLRUPolicyMSPerMBConstraintFunc(intx value, bool verbose);
53JVMFlag::Error MarkStackSizeConstraintFunc(size_t value, bool verbose);
54JVMFlag::Error MinMetaspaceFreeRatioConstraintFunc(uintx value, bool verbose);
55JVMFlag::Error MaxMetaspaceFreeRatioConstraintFunc(uintx value, bool verbose);
56JVMFlag::Error InitialTenuringThresholdConstraintFunc(uintx value, bool verbose);
57JVMFlag::Error MaxTenuringThresholdConstraintFunc(uintx value, bool verbose);
58
59JVMFlag::Error MaxGCPauseMillisConstraintFunc(uintx value, bool verbose);
60JVMFlag::Error GCPauseIntervalMillisConstraintFunc(uintx value, bool verbose);
61JVMFlag::Error InitialBootClassLoaderMetaspaceSizeConstraintFunc(size_t value, bool verbose);
62JVMFlag::Error MinHeapSizeConstraintFunc(size_t value, bool verbose);
63JVMFlag::Error InitialHeapSizeConstraintFunc(size_t value, bool verbose);
64JVMFlag::Error MaxHeapSizeConstraintFunc(size_t value, bool verbose);
65JVMFlag::Error SoftMaxHeapSizeConstraintFunc(size_t value, bool verbose);
66JVMFlag::Error HeapBaseMinAddressConstraintFunc(size_t value, bool verbose);
67JVMFlag::Error NewSizeConstraintFunc(size_t value, bool verbose);
68JVMFlag::Error MinTLABSizeConstraintFunc(size_t value, bool verbose);
69JVMFlag::Error TLABSizeConstraintFunc(size_t value, bool verbose);
70JVMFlag::Error TLABWasteIncrementConstraintFunc(uintx value, bool verbose);
71JVMFlag::Error SurvivorRatioConstraintFunc(uintx value, bool verbose);
72JVMFlag::Error MetaspaceSizeConstraintFunc(size_t value, bool verbose);
73JVMFlag::Error MaxMetaspaceSizeConstraintFunc(size_t value, bool verbose);
74JVMFlag::Error SurvivorAlignmentInBytesConstraintFunc(intx value, bool verbose);
75
76// Internal
77JVMFlag::Error MaxPLABSizeBounds(const char* name, size_t value, bool verbose);
78
79#endif // SHARE_GC_SHARED_JVMFLAGCONSTRAINTSGC_HPP
80