src/share/vm/runtime/arguments.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/runtime

src/share/vm/runtime/arguments.cpp

Print this page




 835   st->print_cr("VM Arguments:");
 836   if (num_jvm_flags() > 0) {
 837     st->print("jvm_flags: "); print_jvm_flags_on(st);
 838   }
 839   if (num_jvm_args() > 0) {
 840     st->print("jvm_args: "); print_jvm_args_on(st);
 841   }
 842   st->print_cr("java_command: %s", java_command() ? java_command() : "<unknown>");
 843   if (_java_class_path != NULL) {
 844     char* path = _java_class_path->value();
 845     st->print_cr("java_class_path (initial): %s", strlen(path) == 0 ? "<not set>" : path );
 846   }
 847   st->print_cr("Launcher Type: %s", _sun_java_launcher);
 848 }
 849 
 850 void Arguments::print_jvm_flags_on(outputStream* st) {
 851   if (_num_jvm_flags > 0) {
 852     for (int i=0; i < _num_jvm_flags; i++) {
 853       st->print("%s ", _jvm_flags_array[i]);
 854     }
 855     st->print_cr("");
 856   }
 857 }
 858 
 859 void Arguments::print_jvm_args_on(outputStream* st) {
 860   if (_num_jvm_args > 0) {
 861     for (int i=0; i < _num_jvm_args; i++) {
 862       st->print("%s ", _jvm_args_array[i]);
 863     }
 864     st->print_cr("");
 865   }
 866 }
 867 
 868 bool Arguments::process_argument(const char* arg,
 869     jboolean ignore_unrecognized, Flag::Flags origin) {
 870 
 871   JDK_Version since = JDK_Version();
 872 
 873   if (parse_argument(arg, origin) || ignore_unrecognized) {
 874     return true;
 875   }
 876 
 877   bool has_plus_minus = (*arg == '+' || *arg == '-');
 878   const char* const argname = has_plus_minus ? arg + 1 : arg;
 879   if (is_newly_obsolete(arg, &since)) {
 880     char version[256];
 881     since.to_string(version, sizeof(version));
 882     warning("ignoring option %s; support was removed in %s", argname, version);
 883     return true;
 884   }


1332                   " CMSParPromoteBlocksToClaim will take precedence.\n");
1333     }
1334   }
1335   if (!FLAG_IS_DEFAULT(ResizeOldPLAB) && !ResizeOldPLAB) {
1336     // OldPLAB sizing manually turned off: Use a larger default setting,
1337     // unless it was manually specified. This is because a too-low value
1338     // will slow down scavenges.
1339     if (FLAG_IS_DEFAULT(CMSParPromoteBlocksToClaim)) {
1340       FLAG_SET_ERGO(uintx, CMSParPromoteBlocksToClaim, 50); // default value before 6631166
1341     }
1342   }
1343   // Overwrite OldPLABSize which is the variable we will internally use everywhere.
1344   FLAG_SET_ERGO(uintx, OldPLABSize, CMSParPromoteBlocksToClaim);
1345   // If either of the static initialization defaults have changed, note this
1346   // modification.
1347   if (!FLAG_IS_DEFAULT(CMSParPromoteBlocksToClaim) || !FLAG_IS_DEFAULT(OldPLABWeight)) {
1348     CFLS_LAB::modify_initialization(OldPLABSize, OldPLABWeight);
1349   }
1350   if (PrintGCDetails && Verbose) {
1351     tty->print_cr("MarkStackSize: %uk  MarkStackSizeMax: %uk",
1352       MarkStackSize / K, MarkStackSizeMax / K);
1353     tty->print_cr("ConcGCThreads: %u", ConcGCThreads);
1354   }
1355 }
1356 #endif // INCLUDE_ALL_GCS
1357 
1358 void set_object_alignment() {
1359   // Object alignment.
1360   assert(is_power_of_2(ObjectAlignmentInBytes), "ObjectAlignmentInBytes must be power of 2");
1361   MinObjAlignmentInBytes     = ObjectAlignmentInBytes;
1362   assert(MinObjAlignmentInBytes >= HeapWordsPerLong * HeapWordSize, "ObjectAlignmentInBytes value is too small");
1363   MinObjAlignment            = MinObjAlignmentInBytes / HeapWordSize;
1364   assert(MinObjAlignmentInBytes == MinObjAlignment * HeapWordSize, "ObjectAlignmentInBytes value is incorrect");
1365   MinObjAlignmentInBytesMask = MinObjAlignmentInBytes - 1;
1366 
1367   LogMinObjAlignmentInBytes  = exact_log2(ObjectAlignmentInBytes);
1368   LogMinObjAlignment         = LogMinObjAlignmentInBytes - LogHeapWordSize;
1369 
1370   // Oop encoding heap max
1371   OopEncodingHeapMax = (uint64_t(max_juint) + 1) << LogMinObjAlignmentInBytes;
1372 
1373 #if INCLUDE_ALL_GCS


1413   // Avoid sign flip.
1414   assert(OopEncodingHeapMax > (uint64_t)os::vm_page_size(), "Unusual page size");
1415   // We need to fit both the NULL page and the heap into the memory budget, while
1416   // keeping alignment constraints of the heap. To guarantee the latter, as the
1417   // NULL page is located before the heap, we pad the NULL page to the conservative
1418   // maximum alignment that the GC may ever impose upon the heap.
1419   size_t displacement_due_to_null_page = align_size_up_(os::vm_page_size(),
1420                                                         _conservative_max_heap_alignment);
1421 
1422   LP64_ONLY(return OopEncodingHeapMax - displacement_due_to_null_page);
1423   NOT_LP64(ShouldNotReachHere(); return 0);
1424 }
1425 
1426 bool Arguments::should_auto_select_low_pause_collector() {
1427   if (UseAutoGCSelectPolicy &&
1428       !FLAG_IS_DEFAULT(MaxGCPauseMillis) &&
1429       (MaxGCPauseMillis <= AutoGCSelectPauseMillis)) {
1430     if (PrintGCDetails) {
1431       // Cannot use gclog_or_tty yet.
1432       tty->print_cr("Automatic selection of the low pause collector"
1433        " based on pause goal of %d (ms)", MaxGCPauseMillis);
1434     }
1435     return true;
1436   }
1437   return false;
1438 }
1439 
1440 void Arguments::set_use_compressed_oops() {
1441 #ifndef ZERO
1442 #ifdef _LP64
1443   // MaxHeapSize is not set up properly at this point, but
1444   // the only value that can override MaxHeapSize if we are
1445   // to use UseCompressedOops is InitialHeapSize.
1446   size_t max_heap_size = MAX2(MaxHeapSize, InitialHeapSize);
1447 
1448   if (max_heap_size <= max_heap_for_compressed_oops()) {
1449 #if !defined(COMPILER1) || defined(TIERED)
1450     if (FLAG_IS_DEFAULT(UseCompressedOops)) {
1451       FLAG_SET_ERGO(bool, UseCompressedOops, true);
1452     }
1453 #endif


1630   // MarkStackSize will be set (if it hasn't been set by the user)
1631   // when concurrent marking is initialized.
1632   // Its value will be based upon the number of parallel marking threads.
1633   // But we do set the maximum mark stack size here.
1634   if (FLAG_IS_DEFAULT(MarkStackSizeMax)) {
1635     FLAG_SET_DEFAULT(MarkStackSizeMax, 128 * TASKQUEUE_SIZE);
1636   }
1637 
1638   if (FLAG_IS_DEFAULT(GCTimeRatio) || GCTimeRatio == 0) {
1639     // In G1, we want the default GC overhead goal to be higher than
1640     // say in PS. So we set it here to 10%. Otherwise the heap might
1641     // be expanded more aggressively than we would like it to. In
1642     // fact, even 10% seems to not be high enough in some cases
1643     // (especially small GC stress tests that the main thing they do
1644     // is allocation). We might consider increase it further.
1645     FLAG_SET_DEFAULT(GCTimeRatio, 9);
1646   }
1647 
1648   if (PrintGCDetails && Verbose) {
1649     tty->print_cr("MarkStackSize: %uk  MarkStackSizeMax: %uk",
1650       MarkStackSize / K, MarkStackSizeMax / K);
1651     tty->print_cr("ConcGCThreads: %u", ConcGCThreads);
1652   }
1653 }
1654 
1655 julong Arguments::limit_by_allocatable_memory(julong limit) {
1656   julong max_allocatable;
1657   julong result = limit;
1658   if (os::has_allocatable_memory_limit(&max_allocatable)) {
1659     result = MIN2(result, max_allocatable / MaxVirtMemFraction);
1660   }
1661   return result;
1662 }
1663 
1664 // Use static initialization to get the default before parsing
1665 static const uintx DefaultHeapBaseMinAddress = HeapBaseMinAddress;
1666 
1667 void Arguments::set_heap_size() {
1668   if (!FLAG_IS_DEFAULT(DefaultMaxRAMFraction)) {
1669     // Deprecated flag
1670     FLAG_SET_CMDLINE(uintx, MaxRAMFraction, DefaultMaxRAMFraction);
1671   }


1715 
1716       if (HeapBaseMinAddress + MaxHeapSize < max_coop_heap) {
1717         // Heap should be above HeapBaseMinAddress to get zero based compressed oops
1718         // but it should be not less than default MaxHeapSize.
1719         max_coop_heap -= HeapBaseMinAddress;
1720       }
1721       reasonable_max = MIN2(reasonable_max, max_coop_heap);
1722     }
1723     reasonable_max = limit_by_allocatable_memory(reasonable_max);
1724 
1725     if (!FLAG_IS_DEFAULT(InitialHeapSize)) {
1726       // An initial heap size was specified on the command line,
1727       // so be sure that the maximum size is consistent.  Done
1728       // after call to limit_by_allocatable_memory because that
1729       // method might reduce the allocation size.
1730       reasonable_max = MAX2(reasonable_max, (julong)InitialHeapSize);
1731     }
1732 
1733     if (PrintGCDetails && Verbose) {
1734       // Cannot use gclog_or_tty yet.
1735       tty->print_cr("  Maximum heap size " SIZE_FORMAT, reasonable_max);
1736     }
1737     FLAG_SET_ERGO(uintx, MaxHeapSize, (uintx)reasonable_max);
1738   }
1739 
1740   // If the minimum or initial heap_size have not been set or requested to be set
1741   // ergonomically, set them accordingly.
1742   if (InitialHeapSize == 0 || min_heap_size() == 0) {
1743     julong reasonable_minimum = (julong)(OldSize + NewSize);
1744 
1745     reasonable_minimum = MIN2(reasonable_minimum, (julong)MaxHeapSize);
1746 
1747     reasonable_minimum = limit_by_allocatable_memory(reasonable_minimum);
1748 
1749     if (InitialHeapSize == 0) {
1750       julong reasonable_initial = phys_mem / InitialRAMFraction;
1751 
1752       reasonable_initial = MAX3(reasonable_initial, reasonable_minimum, (julong)min_heap_size());
1753       reasonable_initial = MIN2(reasonable_initial, (julong)MaxHeapSize);
1754 
1755       reasonable_initial = limit_by_allocatable_memory(reasonable_initial);


2088                 TLABRefillWasteFraction);
2089     status = false;
2090   }
2091 
2092   status = status && verify_interval(AdaptiveSizePolicyWeight, 0, 100,
2093                               "AdaptiveSizePolicyWeight");
2094   status = status && verify_percentage(ThresholdTolerance, "ThresholdTolerance");
2095 
2096   // Divide by bucket size to prevent a large size from causing rollover when
2097   // calculating amount of memory needed to be allocated for the String table.
2098   status = status && verify_interval(StringTableSize, minimumStringTableSize,
2099     (max_uintx / StringTable::bucket_size()), "StringTable size");
2100 
2101   status = status && verify_interval(SymbolTableSize, minimumSymbolTableSize,
2102     (max_uintx / SymbolTable::bucket_size()), "SymbolTable size");
2103 
2104   {
2105     // Using "else if" below to avoid printing two error messages if min > max.
2106     // This will also prevent us from reporting both min>100 and max>100 at the
2107     // same time, but that is less annoying than printing two identical errors IMHO.
2108     FormatBuffer<80> err_msg("");
2109     if (!verify_MinHeapFreeRatio(err_msg, MinHeapFreeRatio)) {
2110       jio_fprintf(defaultStream::error_stream(), "%s\n", err_msg.buffer());
2111       status = false;
2112     } else if (!verify_MaxHeapFreeRatio(err_msg, MaxHeapFreeRatio)) {
2113       jio_fprintf(defaultStream::error_stream(), "%s\n", err_msg.buffer());
2114       status = false;
2115     }
2116   }
2117 
2118   // Min/MaxMetaspaceFreeRatio
2119   status = status && verify_percentage(MinMetaspaceFreeRatio, "MinMetaspaceFreeRatio");
2120   status = status && verify_percentage(MaxMetaspaceFreeRatio, "MaxMetaspaceFreeRatio");
2121 
2122   if (MinMetaspaceFreeRatio > MaxMetaspaceFreeRatio) {
2123     jio_fprintf(defaultStream::error_stream(),
2124                 "MinMetaspaceFreeRatio (%s" UINTX_FORMAT ") must be less than or "
2125                 "equal to MaxMetaspaceFreeRatio (%s" UINTX_FORMAT ")\n",
2126                 FLAG_IS_DEFAULT(MinMetaspaceFreeRatio) ? "Default: " : "",
2127                 MinMetaspaceFreeRatio,
2128                 FLAG_IS_DEFAULT(MaxMetaspaceFreeRatio) ? "Default: " : "",




 835   st->print_cr("VM Arguments:");
 836   if (num_jvm_flags() > 0) {
 837     st->print("jvm_flags: "); print_jvm_flags_on(st);
 838   }
 839   if (num_jvm_args() > 0) {
 840     st->print("jvm_args: "); print_jvm_args_on(st);
 841   }
 842   st->print_cr("java_command: %s", java_command() ? java_command() : "<unknown>");
 843   if (_java_class_path != NULL) {
 844     char* path = _java_class_path->value();
 845     st->print_cr("java_class_path (initial): %s", strlen(path) == 0 ? "<not set>" : path );
 846   }
 847   st->print_cr("Launcher Type: %s", _sun_java_launcher);
 848 }
 849 
 850 void Arguments::print_jvm_flags_on(outputStream* st) {
 851   if (_num_jvm_flags > 0) {
 852     for (int i=0; i < _num_jvm_flags; i++) {
 853       st->print("%s ", _jvm_flags_array[i]);
 854     }
 855     st->cr();
 856   }
 857 }
 858 
 859 void Arguments::print_jvm_args_on(outputStream* st) {
 860   if (_num_jvm_args > 0) {
 861     for (int i=0; i < _num_jvm_args; i++) {
 862       st->print("%s ", _jvm_args_array[i]);
 863     }
 864     st->cr();
 865   }
 866 }
 867 
 868 bool Arguments::process_argument(const char* arg,
 869     jboolean ignore_unrecognized, Flag::Flags origin) {
 870 
 871   JDK_Version since = JDK_Version();
 872 
 873   if (parse_argument(arg, origin) || ignore_unrecognized) {
 874     return true;
 875   }
 876 
 877   bool has_plus_minus = (*arg == '+' || *arg == '-');
 878   const char* const argname = has_plus_minus ? arg + 1 : arg;
 879   if (is_newly_obsolete(arg, &since)) {
 880     char version[256];
 881     since.to_string(version, sizeof(version));
 882     warning("ignoring option %s; support was removed in %s", argname, version);
 883     return true;
 884   }


1332                   " CMSParPromoteBlocksToClaim will take precedence.\n");
1333     }
1334   }
1335   if (!FLAG_IS_DEFAULT(ResizeOldPLAB) && !ResizeOldPLAB) {
1336     // OldPLAB sizing manually turned off: Use a larger default setting,
1337     // unless it was manually specified. This is because a too-low value
1338     // will slow down scavenges.
1339     if (FLAG_IS_DEFAULT(CMSParPromoteBlocksToClaim)) {
1340       FLAG_SET_ERGO(uintx, CMSParPromoteBlocksToClaim, 50); // default value before 6631166
1341     }
1342   }
1343   // Overwrite OldPLABSize which is the variable we will internally use everywhere.
1344   FLAG_SET_ERGO(uintx, OldPLABSize, CMSParPromoteBlocksToClaim);
1345   // If either of the static initialization defaults have changed, note this
1346   // modification.
1347   if (!FLAG_IS_DEFAULT(CMSParPromoteBlocksToClaim) || !FLAG_IS_DEFAULT(OldPLABWeight)) {
1348     CFLS_LAB::modify_initialization(OldPLABSize, OldPLABWeight);
1349   }
1350   if (PrintGCDetails && Verbose) {
1351     tty->print_cr("MarkStackSize: %uk  MarkStackSizeMax: %uk",
1352       (unsigned int) (MarkStackSize / K), (uint) (MarkStackSizeMax / K));
1353     tty->print_cr("ConcGCThreads: %u", (uint) ConcGCThreads);
1354   }
1355 }
1356 #endif // INCLUDE_ALL_GCS
1357 
1358 void set_object_alignment() {
1359   // Object alignment.
1360   assert(is_power_of_2(ObjectAlignmentInBytes), "ObjectAlignmentInBytes must be power of 2");
1361   MinObjAlignmentInBytes     = ObjectAlignmentInBytes;
1362   assert(MinObjAlignmentInBytes >= HeapWordsPerLong * HeapWordSize, "ObjectAlignmentInBytes value is too small");
1363   MinObjAlignment            = MinObjAlignmentInBytes / HeapWordSize;
1364   assert(MinObjAlignmentInBytes == MinObjAlignment * HeapWordSize, "ObjectAlignmentInBytes value is incorrect");
1365   MinObjAlignmentInBytesMask = MinObjAlignmentInBytes - 1;
1366 
1367   LogMinObjAlignmentInBytes  = exact_log2(ObjectAlignmentInBytes);
1368   LogMinObjAlignment         = LogMinObjAlignmentInBytes - LogHeapWordSize;
1369 
1370   // Oop encoding heap max
1371   OopEncodingHeapMax = (uint64_t(max_juint) + 1) << LogMinObjAlignmentInBytes;
1372 
1373 #if INCLUDE_ALL_GCS


1413   // Avoid sign flip.
1414   assert(OopEncodingHeapMax > (uint64_t)os::vm_page_size(), "Unusual page size");
1415   // We need to fit both the NULL page and the heap into the memory budget, while
1416   // keeping alignment constraints of the heap. To guarantee the latter, as the
1417   // NULL page is located before the heap, we pad the NULL page to the conservative
1418   // maximum alignment that the GC may ever impose upon the heap.
1419   size_t displacement_due_to_null_page = align_size_up_(os::vm_page_size(),
1420                                                         _conservative_max_heap_alignment);
1421 
1422   LP64_ONLY(return OopEncodingHeapMax - displacement_due_to_null_page);
1423   NOT_LP64(ShouldNotReachHere(); return 0);
1424 }
1425 
1426 bool Arguments::should_auto_select_low_pause_collector() {
1427   if (UseAutoGCSelectPolicy &&
1428       !FLAG_IS_DEFAULT(MaxGCPauseMillis) &&
1429       (MaxGCPauseMillis <= AutoGCSelectPauseMillis)) {
1430     if (PrintGCDetails) {
1431       // Cannot use gclog_or_tty yet.
1432       tty->print_cr("Automatic selection of the low pause collector"
1433        " based on pause goal of %d (ms)", (int) MaxGCPauseMillis);
1434     }
1435     return true;
1436   }
1437   return false;
1438 }
1439 
1440 void Arguments::set_use_compressed_oops() {
1441 #ifndef ZERO
1442 #ifdef _LP64
1443   // MaxHeapSize is not set up properly at this point, but
1444   // the only value that can override MaxHeapSize if we are
1445   // to use UseCompressedOops is InitialHeapSize.
1446   size_t max_heap_size = MAX2(MaxHeapSize, InitialHeapSize);
1447 
1448   if (max_heap_size <= max_heap_for_compressed_oops()) {
1449 #if !defined(COMPILER1) || defined(TIERED)
1450     if (FLAG_IS_DEFAULT(UseCompressedOops)) {
1451       FLAG_SET_ERGO(bool, UseCompressedOops, true);
1452     }
1453 #endif


1630   // MarkStackSize will be set (if it hasn't been set by the user)
1631   // when concurrent marking is initialized.
1632   // Its value will be based upon the number of parallel marking threads.
1633   // But we do set the maximum mark stack size here.
1634   if (FLAG_IS_DEFAULT(MarkStackSizeMax)) {
1635     FLAG_SET_DEFAULT(MarkStackSizeMax, 128 * TASKQUEUE_SIZE);
1636   }
1637 
1638   if (FLAG_IS_DEFAULT(GCTimeRatio) || GCTimeRatio == 0) {
1639     // In G1, we want the default GC overhead goal to be higher than
1640     // say in PS. So we set it here to 10%. Otherwise the heap might
1641     // be expanded more aggressively than we would like it to. In
1642     // fact, even 10% seems to not be high enough in some cases
1643     // (especially small GC stress tests that the main thing they do
1644     // is allocation). We might consider increase it further.
1645     FLAG_SET_DEFAULT(GCTimeRatio, 9);
1646   }
1647 
1648   if (PrintGCDetails && Verbose) {
1649     tty->print_cr("MarkStackSize: %uk  MarkStackSizeMax: %uk",
1650       (unsigned int) (MarkStackSize / K), (uint) (MarkStackSizeMax / K));
1651     tty->print_cr("ConcGCThreads: %u", (uint) ConcGCThreads);
1652   }
1653 }
1654 
1655 julong Arguments::limit_by_allocatable_memory(julong limit) {
1656   julong max_allocatable;
1657   julong result = limit;
1658   if (os::has_allocatable_memory_limit(&max_allocatable)) {
1659     result = MIN2(result, max_allocatable / MaxVirtMemFraction);
1660   }
1661   return result;
1662 }
1663 
1664 // Use static initialization to get the default before parsing
1665 static const uintx DefaultHeapBaseMinAddress = HeapBaseMinAddress;
1666 
1667 void Arguments::set_heap_size() {
1668   if (!FLAG_IS_DEFAULT(DefaultMaxRAMFraction)) {
1669     // Deprecated flag
1670     FLAG_SET_CMDLINE(uintx, MaxRAMFraction, DefaultMaxRAMFraction);
1671   }


1715 
1716       if (HeapBaseMinAddress + MaxHeapSize < max_coop_heap) {
1717         // Heap should be above HeapBaseMinAddress to get zero based compressed oops
1718         // but it should be not less than default MaxHeapSize.
1719         max_coop_heap -= HeapBaseMinAddress;
1720       }
1721       reasonable_max = MIN2(reasonable_max, max_coop_heap);
1722     }
1723     reasonable_max = limit_by_allocatable_memory(reasonable_max);
1724 
1725     if (!FLAG_IS_DEFAULT(InitialHeapSize)) {
1726       // An initial heap size was specified on the command line,
1727       // so be sure that the maximum size is consistent.  Done
1728       // after call to limit_by_allocatable_memory because that
1729       // method might reduce the allocation size.
1730       reasonable_max = MAX2(reasonable_max, (julong)InitialHeapSize);
1731     }
1732 
1733     if (PrintGCDetails && Verbose) {
1734       // Cannot use gclog_or_tty yet.
1735       tty->print_cr("  Maximum heap size " SIZE_FORMAT, (size_t) reasonable_max);
1736     }
1737     FLAG_SET_ERGO(uintx, MaxHeapSize, (uintx)reasonable_max);
1738   }
1739 
1740   // If the minimum or initial heap_size have not been set or requested to be set
1741   // ergonomically, set them accordingly.
1742   if (InitialHeapSize == 0 || min_heap_size() == 0) {
1743     julong reasonable_minimum = (julong)(OldSize + NewSize);
1744 
1745     reasonable_minimum = MIN2(reasonable_minimum, (julong)MaxHeapSize);
1746 
1747     reasonable_minimum = limit_by_allocatable_memory(reasonable_minimum);
1748 
1749     if (InitialHeapSize == 0) {
1750       julong reasonable_initial = phys_mem / InitialRAMFraction;
1751 
1752       reasonable_initial = MAX3(reasonable_initial, reasonable_minimum, (julong)min_heap_size());
1753       reasonable_initial = MIN2(reasonable_initial, (julong)MaxHeapSize);
1754 
1755       reasonable_initial = limit_by_allocatable_memory(reasonable_initial);


2088                 TLABRefillWasteFraction);
2089     status = false;
2090   }
2091 
2092   status = status && verify_interval(AdaptiveSizePolicyWeight, 0, 100,
2093                               "AdaptiveSizePolicyWeight");
2094   status = status && verify_percentage(ThresholdTolerance, "ThresholdTolerance");
2095 
2096   // Divide by bucket size to prevent a large size from causing rollover when
2097   // calculating amount of memory needed to be allocated for the String table.
2098   status = status && verify_interval(StringTableSize, minimumStringTableSize,
2099     (max_uintx / StringTable::bucket_size()), "StringTable size");
2100 
2101   status = status && verify_interval(SymbolTableSize, minimumSymbolTableSize,
2102     (max_uintx / SymbolTable::bucket_size()), "SymbolTable size");
2103 
2104   {
2105     // Using "else if" below to avoid printing two error messages if min > max.
2106     // This will also prevent us from reporting both min>100 and max>100 at the
2107     // same time, but that is less annoying than printing two identical errors IMHO.
2108     FormatBuffer<80> err_msg("%s","");
2109     if (!verify_MinHeapFreeRatio(err_msg, MinHeapFreeRatio)) {
2110       jio_fprintf(defaultStream::error_stream(), "%s\n", err_msg.buffer());
2111       status = false;
2112     } else if (!verify_MaxHeapFreeRatio(err_msg, MaxHeapFreeRatio)) {
2113       jio_fprintf(defaultStream::error_stream(), "%s\n", err_msg.buffer());
2114       status = false;
2115     }
2116   }
2117 
2118   // Min/MaxMetaspaceFreeRatio
2119   status = status && verify_percentage(MinMetaspaceFreeRatio, "MinMetaspaceFreeRatio");
2120   status = status && verify_percentage(MaxMetaspaceFreeRatio, "MaxMetaspaceFreeRatio");
2121 
2122   if (MinMetaspaceFreeRatio > MaxMetaspaceFreeRatio) {
2123     jio_fprintf(defaultStream::error_stream(),
2124                 "MinMetaspaceFreeRatio (%s" UINTX_FORMAT ") must be less than or "
2125                 "equal to MaxMetaspaceFreeRatio (%s" UINTX_FORMAT ")\n",
2126                 FLAG_IS_DEFAULT(MinMetaspaceFreeRatio) ? "Default: " : "",
2127                 MinMetaspaceFreeRatio,
2128                 FLAG_IS_DEFAULT(MaxMetaspaceFreeRatio) ? "Default: " : "",


src/share/vm/runtime/arguments.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File