src/share/vm/runtime/arguments.cpp

Print this page
rev 5311 : imported patch cleanup


   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 #include "precompiled.hpp"

  26 #include "classfile/javaAssertions.hpp"
  27 #include "classfile/symbolTable.hpp"
  28 #include "compiler/compilerOracle.hpp"
  29 #include "memory/allocation.inline.hpp"
  30 #include "memory/cardTableRS.hpp"
  31 #include "memory/genCollectedHeap.hpp"
  32 #include "memory/referenceProcessor.hpp"
  33 #include "memory/universe.inline.hpp"
  34 #include "oops/oop.inline.hpp"
  35 #include "prims/jvmtiExport.hpp"
  36 #include "runtime/arguments.hpp"
  37 #include "runtime/globals_extension.hpp"
  38 #include "runtime/java.hpp"
  39 #include "services/management.hpp"
  40 #include "services/memTracker.hpp"
  41 #include "utilities/defaultStream.hpp"
  42 #include "utilities/macros.hpp"
  43 #include "utilities/taskqueue.hpp"
  44 #ifdef TARGET_OS_FAMILY_linux
  45 # include "os_linux.inline.hpp"


2020 #endif
2021 
2022   if (TLABRefillWasteFraction == 0) {
2023     jio_fprintf(defaultStream::error_stream(),
2024                 "TLABRefillWasteFraction should be a denominator, "
2025                 "not " SIZE_FORMAT "\n",
2026                 TLABRefillWasteFraction);
2027     status = false;
2028   }
2029 
2030   status = status && verify_interval(AdaptiveSizePolicyWeight, 0, 100,
2031                               "AdaptiveSizePolicyWeight");
2032   status = status && verify_percentage(ThresholdTolerance, "ThresholdTolerance");
2033   status = status && verify_percentage(MinHeapFreeRatio, "MinHeapFreeRatio");
2034   status = status && verify_percentage(MaxHeapFreeRatio, "MaxHeapFreeRatio");
2035 
2036   // Divide by bucket size to prevent a large size from causing rollover when
2037   // calculating amount of memory needed to be allocated for the String table.
2038   status = status && verify_interval(StringTableSize, minimumStringTableSize,
2039     (max_uintx / StringTable::bucket_size()), "StringTable size");



2040 
2041   if (MinHeapFreeRatio > MaxHeapFreeRatio) {
2042     jio_fprintf(defaultStream::error_stream(),
2043                 "MinHeapFreeRatio (" UINTX_FORMAT ") must be less than or "
2044                 "equal to MaxHeapFreeRatio (" UINTX_FORMAT ")\n",
2045                 MinHeapFreeRatio, MaxHeapFreeRatio);
2046     status = false;
2047   }
2048   // Keeping the heap 100% free is hard ;-) so limit it to 99%.
2049   MinHeapFreeRatio = MIN2(MinHeapFreeRatio, (uintx) 99);
2050 
2051   // Min/MaxMetaspaceFreeRatio
2052   status = status && verify_percentage(MinMetaspaceFreeRatio, "MinMetaspaceFreeRatio");
2053   status = status && verify_percentage(MaxMetaspaceFreeRatio, "MaxMetaspaceFreeRatio");
2054 
2055   if (MinMetaspaceFreeRatio > MaxMetaspaceFreeRatio) {
2056     jio_fprintf(defaultStream::error_stream(),
2057                 "MinMetaspaceFreeRatio (%s" UINTX_FORMAT ") must be less than or "
2058                 "equal to MaxMetaspaceFreeRatio (%s" UINTX_FORMAT ")\n",
2059                 FLAG_IS_DEFAULT(MinMetaspaceFreeRatio) ? "Default: " : "",




   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 #include "precompiled.hpp"
  26 #include "classfile/dictionary.hpp"
  27 #include "classfile/javaAssertions.hpp"
  28 #include "classfile/symbolTable.hpp"
  29 #include "compiler/compilerOracle.hpp"
  30 #include "memory/allocation.inline.hpp"
  31 #include "memory/cardTableRS.hpp"
  32 #include "memory/genCollectedHeap.hpp"
  33 #include "memory/referenceProcessor.hpp"
  34 #include "memory/universe.inline.hpp"
  35 #include "oops/oop.inline.hpp"
  36 #include "prims/jvmtiExport.hpp"
  37 #include "runtime/arguments.hpp"
  38 #include "runtime/globals_extension.hpp"
  39 #include "runtime/java.hpp"
  40 #include "services/management.hpp"
  41 #include "services/memTracker.hpp"
  42 #include "utilities/defaultStream.hpp"
  43 #include "utilities/macros.hpp"
  44 #include "utilities/taskqueue.hpp"
  45 #ifdef TARGET_OS_FAMILY_linux
  46 # include "os_linux.inline.hpp"


2021 #endif
2022 
2023   if (TLABRefillWasteFraction == 0) {
2024     jio_fprintf(defaultStream::error_stream(),
2025                 "TLABRefillWasteFraction should be a denominator, "
2026                 "not " SIZE_FORMAT "\n",
2027                 TLABRefillWasteFraction);
2028     status = false;
2029   }
2030 
2031   status = status && verify_interval(AdaptiveSizePolicyWeight, 0, 100,
2032                               "AdaptiveSizePolicyWeight");
2033   status = status && verify_percentage(ThresholdTolerance, "ThresholdTolerance");
2034   status = status && verify_percentage(MinHeapFreeRatio, "MinHeapFreeRatio");
2035   status = status && verify_percentage(MaxHeapFreeRatio, "MaxHeapFreeRatio");
2036 
2037   // Divide by bucket size to prevent a large size from causing rollover when
2038   // calculating amount of memory needed to be allocated for the String table.
2039   status = status && verify_interval(StringTableSize, minimumStringTableSize,
2040     (max_uintx / StringTable::bucket_size()), "StringTable size");
2041 
2042   status = status && verify_interval(ProtectionDomainCacheSize, minimumProtectionDomainCacheSize,
2043     (max_uintx / ProtectionDomainCacheTable::bucket_size()), "ProtectionDomainCache size");
2044 
2045   if (MinHeapFreeRatio > MaxHeapFreeRatio) {
2046     jio_fprintf(defaultStream::error_stream(),
2047                 "MinHeapFreeRatio (" UINTX_FORMAT ") must be less than or "
2048                 "equal to MaxHeapFreeRatio (" UINTX_FORMAT ")\n",
2049                 MinHeapFreeRatio, MaxHeapFreeRatio);
2050     status = false;
2051   }
2052   // Keeping the heap 100% free is hard ;-) so limit it to 99%.
2053   MinHeapFreeRatio = MIN2(MinHeapFreeRatio, (uintx) 99);
2054 
2055   // Min/MaxMetaspaceFreeRatio
2056   status = status && verify_percentage(MinMetaspaceFreeRatio, "MinMetaspaceFreeRatio");
2057   status = status && verify_percentage(MaxMetaspaceFreeRatio, "MaxMetaspaceFreeRatio");
2058 
2059   if (MinMetaspaceFreeRatio > MaxMetaspaceFreeRatio) {
2060     jio_fprintf(defaultStream::error_stream(),
2061                 "MinMetaspaceFreeRatio (%s" UINTX_FORMAT ") must be less than or "
2062                 "equal to MaxMetaspaceFreeRatio (%s" UINTX_FORMAT ")\n",
2063                 FLAG_IS_DEFAULT(MinMetaspaceFreeRatio) ? "Default: " : "",