src/hotspot/share/gc/shared/jvmFlagConstraintsGC.cpp
changeset 55283 4556dd808daa
parent 54982 b18c8301b8c2
child 55308 871bc449ce06
--- a/src/hotspot/share/gc/shared/jvmFlagConstraintsGC.cpp	Fri Jun 07 11:19:34 2019 +0200
+++ b/src/hotspot/share/gc/shared/jvmFlagConstraintsGC.cpp	Fri Jun 07 11:19:34 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -332,6 +332,15 @@
   return status;
 }
 
+JVMFlag::Error SoftMaxHeapSizeConstraintFunc(size_t value, bool verbose) {
+  if (value > MaxHeapSize) {
+    JVMFlag::printError(verbose, "SoftMaxHeapSize must be less than or equal to the maximum heap size\n");
+    return JVMFlag::VIOLATES_CONSTRAINT;
+  }
+
+  return JVMFlag::SUCCESS;
+}
+
 JVMFlag::Error HeapBaseMinAddressConstraintFunc(size_t value, bool verbose) {
   // If an overflow happened in Arguments::set_heap_size(), MaxHeapSize will have too large a value.
   // Check for this by ensuring that MaxHeapSize plus the requested min base address still fit within max_uintx.