comparison src/share/vm/runtime/arguments.cpp @ 18058:54bc75c144b0

Merge
author asaha
date Thu, 29 May 2014 13:14:25 -0700
parents fbf689f3752e 78bbf4d43a14
children ca6d25be853b
comparison
equal deleted inserted replaced
18055:1fa005fb28f5 18058:54bc75c144b0
1 /* 1 /*
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 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 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
47 #ifdef TARGET_OS_FAMILY_solaris 47 #ifdef TARGET_OS_FAMILY_solaris
48 # include "os_solaris.inline.hpp" 48 # include "os_solaris.inline.hpp"
49 #endif 49 #endif
50 #ifdef TARGET_OS_FAMILY_windows 50 #ifdef TARGET_OS_FAMILY_windows
51 # include "os_windows.inline.hpp" 51 # include "os_windows.inline.hpp"
52 #endif
53 #ifdef TARGET_OS_FAMILY_aix
54 # include "os_aix.inline.hpp"
52 #endif 55 #endif
53 #ifdef TARGET_OS_FAMILY_bsd 56 #ifdef TARGET_OS_FAMILY_bsd
54 # include "os_bsd.inline.hpp" 57 # include "os_bsd.inline.hpp"
55 #endif 58 #endif
56 #if INCLUDE_ALL_GCS 59 #if INCLUDE_ALL_GCS
288 { "UseSplitVerifier", JDK_Version::jdk(8), JDK_Version::jdk(9) }, 291 { "UseSplitVerifier", JDK_Version::jdk(8), JDK_Version::jdk(9) },
289 { "UseISM", JDK_Version::jdk(8), JDK_Version::jdk(9) }, 292 { "UseISM", JDK_Version::jdk(8), JDK_Version::jdk(9) },
290 { "UsePermISM", JDK_Version::jdk(8), JDK_Version::jdk(9) }, 293 { "UsePermISM", JDK_Version::jdk(8), JDK_Version::jdk(9) },
291 { "UseMPSS", JDK_Version::jdk(8), JDK_Version::jdk(9) }, 294 { "UseMPSS", JDK_Version::jdk(8), JDK_Version::jdk(9) },
292 { "UseStringCache", JDK_Version::jdk(8), JDK_Version::jdk(9) }, 295 { "UseStringCache", JDK_Version::jdk(8), JDK_Version::jdk(9) },
296 { "UseOldInlining", JDK_Version::jdk(9), JDK_Version::jdk(10) },
293 #ifdef PRODUCT 297 #ifdef PRODUCT
294 { "DesiredMethodLimit", 298 { "DesiredMethodLimit",
295 JDK_Version::jdk_update(7, 2), JDK_Version::jdk(8) }, 299 JDK_Version::jdk_update(7, 2), JDK_Version::jdk(8) },
296 #endif // PRODUCT 300 #endif // PRODUCT
297 { NULL, JDK_Version(0), JDK_Version(0) } 301 { NULL, JDK_Version(0), JDK_Version(0) }
834 void Arguments::print_jvm_flags_on(outputStream* st) { 838 void Arguments::print_jvm_flags_on(outputStream* st) {
835 if (_num_jvm_flags > 0) { 839 if (_num_jvm_flags > 0) {
836 for (int i=0; i < _num_jvm_flags; i++) { 840 for (int i=0; i < _num_jvm_flags; i++) {
837 st->print("%s ", _jvm_flags_array[i]); 841 st->print("%s ", _jvm_flags_array[i]);
838 } 842 }
839 st->print_cr(""); 843 st->cr();
840 } 844 }
841 } 845 }
842 846
843 void Arguments::print_jvm_args_on(outputStream* st) { 847 void Arguments::print_jvm_args_on(outputStream* st) {
844 if (_num_jvm_args > 0) { 848 if (_num_jvm_args > 0) {
845 for (int i=0; i < _num_jvm_args; i++) { 849 for (int i=0; i < _num_jvm_args; i++) {
846 st->print("%s ", _jvm_args_array[i]); 850 st->print("%s ", _jvm_args_array[i]);
847 } 851 }
848 st->print_cr(""); 852 st->cr();
849 } 853 }
850 } 854 }
851 855
852 bool Arguments::process_argument(const char* arg, 856 bool Arguments::process_argument(const char* arg,
853 jboolean ignore_unrecognized, Flag::Flags origin) { 857 jboolean ignore_unrecognized, Flag::Flags origin) {
876 arg_len = strlen(argname); 880 arg_len = strlen(argname);
877 } else { 881 } else {
878 arg_len = equal_sign - argname; 882 arg_len = equal_sign - argname;
879 } 883 }
880 884
881 Flag* found_flag = Flag::find_flag((const char*)argname, arg_len, true); 885 Flag* found_flag = Flag::find_flag((const char*)argname, arg_len, true, true);
882 if (found_flag != NULL) { 886 if (found_flag != NULL) {
883 char locked_message_buf[BUFLEN]; 887 char locked_message_buf[BUFLEN];
884 found_flag->get_locked_message(locked_message_buf, BUFLEN); 888 found_flag->get_locked_message(locked_message_buf, BUFLEN);
885 if (strlen(locked_message_buf) == 0) { 889 if (strlen(locked_message_buf) == 0) {
886 if (found_flag->is_bool() && !has_plus_minus) { 890 if (found_flag->is_bool() && !has_plus_minus) {
1335 if (!FLAG_IS_DEFAULT(CMSParPromoteBlocksToClaim) || !FLAG_IS_DEFAULT(OldPLABWeight)) { 1339 if (!FLAG_IS_DEFAULT(CMSParPromoteBlocksToClaim) || !FLAG_IS_DEFAULT(OldPLABWeight)) {
1336 CFLS_LAB::modify_initialization(OldPLABSize, OldPLABWeight); 1340 CFLS_LAB::modify_initialization(OldPLABSize, OldPLABWeight);
1337 } 1341 }
1338 if (PrintGCDetails && Verbose) { 1342 if (PrintGCDetails && Verbose) {
1339 tty->print_cr("MarkStackSize: %uk MarkStackSizeMax: %uk", 1343 tty->print_cr("MarkStackSize: %uk MarkStackSizeMax: %uk",
1340 MarkStackSize / K, MarkStackSizeMax / K); 1344 (unsigned int) (MarkStackSize / K), (uint) (MarkStackSizeMax / K));
1341 tty->print_cr("ConcGCThreads: %u", ConcGCThreads); 1345 tty->print_cr("ConcGCThreads: %u", (uint) ConcGCThreads);
1342 } 1346 }
1343 } 1347 }
1344 #endif // INCLUDE_ALL_GCS 1348 #endif // INCLUDE_ALL_GCS
1345 1349
1346 void set_object_alignment() { 1350 void set_object_alignment() {
1416 !FLAG_IS_DEFAULT(MaxGCPauseMillis) && 1420 !FLAG_IS_DEFAULT(MaxGCPauseMillis) &&
1417 (MaxGCPauseMillis <= AutoGCSelectPauseMillis)) { 1421 (MaxGCPauseMillis <= AutoGCSelectPauseMillis)) {
1418 if (PrintGCDetails) { 1422 if (PrintGCDetails) {
1419 // Cannot use gclog_or_tty yet. 1423 // Cannot use gclog_or_tty yet.
1420 tty->print_cr("Automatic selection of the low pause collector" 1424 tty->print_cr("Automatic selection of the low pause collector"
1421 " based on pause goal of %d (ms)", MaxGCPauseMillis); 1425 " based on pause goal of %d (ms)", (int) MaxGCPauseMillis);
1422 } 1426 }
1423 return true; 1427 return true;
1424 } 1428 }
1425 return false; 1429 return false;
1426 } 1430 }
1567 jio_fprintf(defaultStream::error_stream(), 1571 jio_fprintf(defaultStream::error_stream(),
1568 "The Parallel GC can not be combined with -XX:ParallelGCThreads=0\n"); 1572 "The Parallel GC can not be combined with -XX:ParallelGCThreads=0\n");
1569 vm_exit(1); 1573 vm_exit(1);
1570 } 1574 }
1571 1575
1576 if (UseAdaptiveSizePolicy) {
1577 // We don't want to limit adaptive heap sizing's freedom to adjust the heap
1578 // unless the user actually sets these flags.
1579 if (FLAG_IS_DEFAULT(MinHeapFreeRatio)) {
1580 FLAG_SET_DEFAULT(MinHeapFreeRatio, 0);
1581 }
1582 if (FLAG_IS_DEFAULT(MaxHeapFreeRatio)) {
1583 FLAG_SET_DEFAULT(MaxHeapFreeRatio, 100);
1584 }
1585 }
1572 1586
1573 // If InitialSurvivorRatio or MinSurvivorRatio were not specified, but the 1587 // If InitialSurvivorRatio or MinSurvivorRatio were not specified, but the
1574 // SurvivorRatio has been set, reset their default values to SurvivorRatio + 1588 // SurvivorRatio has been set, reset their default values to SurvivorRatio +
1575 // 2. By doing this we make SurvivorRatio also work for Parallel Scavenger. 1589 // 2. By doing this we make SurvivorRatio also work for Parallel Scavenger.
1576 // See CR 6362902 for details. 1590 // See CR 6362902 for details.
1623 FLAG_SET_DEFAULT(GCTimeRatio, 9); 1637 FLAG_SET_DEFAULT(GCTimeRatio, 9);
1624 } 1638 }
1625 1639
1626 if (PrintGCDetails && Verbose) { 1640 if (PrintGCDetails && Verbose) {
1627 tty->print_cr("MarkStackSize: %uk MarkStackSizeMax: %uk", 1641 tty->print_cr("MarkStackSize: %uk MarkStackSizeMax: %uk",
1628 MarkStackSize / K, MarkStackSizeMax / K); 1642 (unsigned int) (MarkStackSize / K), (uint) (MarkStackSizeMax / K));
1629 tty->print_cr("ConcGCThreads: %u", ConcGCThreads); 1643 tty->print_cr("ConcGCThreads: %u", (uint) ConcGCThreads);
1630 } 1644 }
1631 } 1645 }
1632 1646
1633 julong Arguments::limit_by_allocatable_memory(julong limit) { 1647 julong Arguments::limit_by_allocatable_memory(julong limit) {
1634 julong max_allocatable; 1648 julong max_allocatable;
1687 reasonable_max = MAX2(reasonable_max, (julong)InitialHeapSize); 1701 reasonable_max = MAX2(reasonable_max, (julong)InitialHeapSize);
1688 } 1702 }
1689 1703
1690 if (PrintGCDetails && Verbose) { 1704 if (PrintGCDetails && Verbose) {
1691 // Cannot use gclog_or_tty yet. 1705 // Cannot use gclog_or_tty yet.
1692 tty->print_cr(" Maximum heap size " SIZE_FORMAT, reasonable_max); 1706 tty->print_cr(" Maximum heap size " SIZE_FORMAT, (size_t) reasonable_max);
1693 } 1707 }
1694 FLAG_SET_ERGO(uintx, MaxHeapSize, (uintx)reasonable_max); 1708 FLAG_SET_ERGO(uintx, MaxHeapSize, (uintx)reasonable_max);
1695 } 1709 }
1696 1710
1697 // If the minimum or initial heap_size have not been set or requested to be set 1711 // If the minimum or initial heap_size have not been set or requested to be set
1842 name, val, min); 1856 name, val, min);
1843 return false; 1857 return false;
1844 } 1858 }
1845 1859
1846 bool Arguments::verify_percentage(uintx value, const char* name) { 1860 bool Arguments::verify_percentage(uintx value, const char* name) {
1847 if (value <= 100) { 1861 if (is_percentage(value)) {
1848 return true; 1862 return true;
1849 } 1863 }
1850 jio_fprintf(defaultStream::error_stream(), 1864 jio_fprintf(defaultStream::error_stream(),
1851 "%s of " UINTX_FORMAT " is invalid; must be between 0 and 100\n", 1865 "%s of " UINTX_FORMAT " is invalid; must be between 0 and 100\n",
1852 name, value); 1866 name, value);
1864 #endif // INCLUDE_ALL_GCS 1878 #endif // INCLUDE_ALL_GCS
1865 1879
1866 // check if do gclog rotation 1880 // check if do gclog rotation
1867 // +UseGCLogFileRotation is a must, 1881 // +UseGCLogFileRotation is a must,
1868 // no gc log rotation when log file not supplied or 1882 // no gc log rotation when log file not supplied or
1869 // NumberOfGCLogFiles is 0, or GCLogFileSize is 0 1883 // NumberOfGCLogFiles is 0
1870 void check_gclog_consistency() { 1884 void check_gclog_consistency() {
1871 if (UseGCLogFileRotation) { 1885 if (UseGCLogFileRotation) {
1872 if ((Arguments::gc_log_filename() == NULL) || 1886 if ((Arguments::gc_log_filename() == NULL) || (NumberOfGCLogFiles == 0)) {
1873 (NumberOfGCLogFiles == 0) ||
1874 (GCLogFileSize == 0)) {
1875 jio_fprintf(defaultStream::output_stream(), 1887 jio_fprintf(defaultStream::output_stream(),
1876 "To enable GC log rotation, use -Xloggc:<filename> -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=<num_of_files> -XX:GCLogFileSize=<num_of_size>[k|K|m|M|g|G]\n" 1888 "To enable GC log rotation, use -Xloggc:<filename> -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=<num_of_files>\n"
1877 "where num_of_file > 0 and num_of_size > 0\n" 1889 "where num_of_file > 0\n"
1878 "GC log rotation is turned off\n"); 1890 "GC log rotation is turned off\n");
1879 UseGCLogFileRotation = false; 1891 UseGCLogFileRotation = false;
1880 } 1892 }
1881 } 1893 }
1882 1894
1883 if (UseGCLogFileRotation && GCLogFileSize < 8*K) { 1895 if (UseGCLogFileRotation && (GCLogFileSize != 0) && (GCLogFileSize < 8*K)) {
1884 FLAG_SET_CMDLINE(uintx, GCLogFileSize, 8*K); 1896 FLAG_SET_CMDLINE(uintx, GCLogFileSize, 8*K);
1885 jio_fprintf(defaultStream::output_stream(), 1897 jio_fprintf(defaultStream::output_stream(),
1886 "GCLogFileSize changed to minimum 8K\n"); 1898 "GCLogFileSize changed to minimum 8K\n");
1887 } 1899 }
1888 } 1900 }
1889 1901
1890 // This function is called for -Xloggc:<filename>, it can be used 1902 // This function is called for -Xloggc:<filename>, it can be used
1891 // to check if a given file name(or string) conforms to the following 1903 // to check if a given file name(or string) conforms to the following
1928 } 1940 }
1929 } 1941 }
1930 return false; 1942 return false;
1931 } 1943 }
1932 return count_p < 2 && count_t < 2; 1944 return count_p < 2 && count_t < 2;
1945 }
1946
1947 bool Arguments::verify_MinHeapFreeRatio(FormatBuffer<80>& err_msg, uintx min_heap_free_ratio) {
1948 if (!is_percentage(min_heap_free_ratio)) {
1949 err_msg.print("MinHeapFreeRatio must have a value between 0 and 100");
1950 return false;
1951 }
1952 if (min_heap_free_ratio > MaxHeapFreeRatio) {
1953 err_msg.print("MinHeapFreeRatio (" UINTX_FORMAT ") must be less than or "
1954 "equal to MaxHeapFreeRatio (" UINTX_FORMAT ")", min_heap_free_ratio,
1955 MaxHeapFreeRatio);
1956 return false;
1957 }
1958 return true;
1959 }
1960
1961 bool Arguments::verify_MaxHeapFreeRatio(FormatBuffer<80>& err_msg, uintx max_heap_free_ratio) {
1962 if (!is_percentage(max_heap_free_ratio)) {
1963 err_msg.print("MaxHeapFreeRatio must have a value between 0 and 100");
1964 return false;
1965 }
1966 if (max_heap_free_ratio < MinHeapFreeRatio) {
1967 err_msg.print("MaxHeapFreeRatio (" UINTX_FORMAT ") must be greater than or "
1968 "equal to MinHeapFreeRatio (" UINTX_FORMAT ")", max_heap_free_ratio,
1969 MinHeapFreeRatio);
1970 return false;
1971 }
1972 return true;
1933 } 1973 }
1934 1974
1935 // Check consistency of GC selection 1975 // Check consistency of GC selection
1936 bool Arguments::check_gc_consistency() { 1976 bool Arguments::check_gc_consistency() {
1937 check_gclog_consistency(); 1977 check_gclog_consistency();
2035 } 2075 }
2036 2076
2037 status = status && verify_interval(AdaptiveSizePolicyWeight, 0, 100, 2077 status = status && verify_interval(AdaptiveSizePolicyWeight, 0, 100,
2038 "AdaptiveSizePolicyWeight"); 2078 "AdaptiveSizePolicyWeight");
2039 status = status && verify_percentage(ThresholdTolerance, "ThresholdTolerance"); 2079 status = status && verify_percentage(ThresholdTolerance, "ThresholdTolerance");
2040 status = status && verify_percentage(MinHeapFreeRatio, "MinHeapFreeRatio");
2041 status = status && verify_percentage(MaxHeapFreeRatio, "MaxHeapFreeRatio");
2042 2080
2043 // Divide by bucket size to prevent a large size from causing rollover when 2081 // Divide by bucket size to prevent a large size from causing rollover when
2044 // calculating amount of memory needed to be allocated for the String table. 2082 // calculating amount of memory needed to be allocated for the String table.
2045 status = status && verify_interval(StringTableSize, minimumStringTableSize, 2083 status = status && verify_interval(StringTableSize, minimumStringTableSize,
2046 (max_uintx / StringTable::bucket_size()), "StringTable size"); 2084 (max_uintx / StringTable::bucket_size()), "StringTable size");
2047 2085
2048 status = status && verify_interval(SymbolTableSize, minimumSymbolTableSize, 2086 status = status && verify_interval(SymbolTableSize, minimumSymbolTableSize,
2049 (max_uintx / SymbolTable::bucket_size()), "SymbolTable size"); 2087 (max_uintx / SymbolTable::bucket_size()), "SymbolTable size");
2050 2088
2051 if (MinHeapFreeRatio > MaxHeapFreeRatio) { 2089 {
2052 jio_fprintf(defaultStream::error_stream(), 2090 // Using "else if" below to avoid printing two error messages if min > max.
2053 "MinHeapFreeRatio (" UINTX_FORMAT ") must be less than or " 2091 // This will also prevent us from reporting both min>100 and max>100 at the
2054 "equal to MaxHeapFreeRatio (" UINTX_FORMAT ")\n", 2092 // same time, but that is less annoying than printing two identical errors IMHO.
2055 MinHeapFreeRatio, MaxHeapFreeRatio); 2093 FormatBuffer<80> err_msg("%s","");
2056 status = false; 2094 if (!verify_MinHeapFreeRatio(err_msg, MinHeapFreeRatio)) {
2057 } 2095 jio_fprintf(defaultStream::error_stream(), "%s\n", err_msg.buffer());
2058 // Keeping the heap 100% free is hard ;-) so limit it to 99%. 2096 status = false;
2059 MinHeapFreeRatio = MIN2(MinHeapFreeRatio, (uintx) 99); 2097 } else if (!verify_MaxHeapFreeRatio(err_msg, MaxHeapFreeRatio)) {
2098 jio_fprintf(defaultStream::error_stream(), "%s\n", err_msg.buffer());
2099 status = false;
2100 }
2101 }
2060 2102
2061 // Min/MaxMetaspaceFreeRatio 2103 // Min/MaxMetaspaceFreeRatio
2062 status = status && verify_percentage(MinMetaspaceFreeRatio, "MinMetaspaceFreeRatio"); 2104 status = status && verify_percentage(MinMetaspaceFreeRatio, "MinMetaspaceFreeRatio");
2063 status = status && verify_percentage(MaxMetaspaceFreeRatio, "MaxMetaspaceFreeRatio"); 2105 status = status && verify_percentage(MaxMetaspaceFreeRatio, "MaxMetaspaceFreeRatio");
2064 2106
2174 "G1ConcMarkStepDurationMillis"); 2216 "G1ConcMarkStepDurationMillis");
2175 status = status && verify_interval(G1ConcRSHotCardLimit, 0, max_jubyte, 2217 status = status && verify_interval(G1ConcRSHotCardLimit, 0, max_jubyte,
2176 "G1ConcRSHotCardLimit"); 2218 "G1ConcRSHotCardLimit");
2177 status = status && verify_interval(G1ConcRSLogCacheSize, 0, 31, 2219 status = status && verify_interval(G1ConcRSLogCacheSize, 0, 31,
2178 "G1ConcRSLogCacheSize"); 2220 "G1ConcRSLogCacheSize");
2221 status = status && verify_interval(StringDeduplicationAgeThreshold, 1, markOopDesc::max_age,
2222 "StringDeduplicationAgeThreshold");
2179 } 2223 }
2180 if (UseConcMarkSweepGC) { 2224 if (UseConcMarkSweepGC) {
2181 status = status && verify_min_value(CMSOldPLABNumRefills, 1, "CMSOldPLABNumRefills"); 2225 status = status && verify_min_value(CMSOldPLABNumRefills, 1, "CMSOldPLABNumRefills");
2182 status = status && verify_min_value(CMSOldPLABToleranceFactor, 1, "CMSOldPLABToleranceFactor"); 2226 status = status && verify_min_value(CMSOldPLABToleranceFactor, 1, "CMSOldPLABToleranceFactor");
2183 status = status && verify_min_value(CMSOldPLABMax, 1, "CMSOldPLABMax"); 2227 status = status && verify_min_value(CMSOldPLABMax, 1, "CMSOldPLABMax");
2336 status = false; 2380 status = false;
2337 } 2381 }
2338 2382
2339 status &= verify_interval(NmethodSweepFraction, 1, ReservedCodeCacheSize/K, "NmethodSweepFraction"); 2383 status &= verify_interval(NmethodSweepFraction, 1, ReservedCodeCacheSize/K, "NmethodSweepFraction");
2340 status &= verify_interval(NmethodSweepActivity, 0, 2000, "NmethodSweepActivity"); 2384 status &= verify_interval(NmethodSweepActivity, 0, 2000, "NmethodSweepActivity");
2385
2386 if (!FLAG_IS_DEFAULT(CICompilerCount) && !FLAG_IS_DEFAULT(CICompilerCountPerCPU) && CICompilerCountPerCPU) {
2387 warning("The VM option CICompilerCountPerCPU overrides CICompilerCount.");
2388 }
2341 2389
2342 #ifdef COMPILER1 2390 #ifdef COMPILER1
2343 status &= verify_interval(SafepointPollOffset, 0, os::vm_page_size() - BytesPerWord, "SafepointPollOffset"); 2391 status &= verify_interval(SafepointPollOffset, 0, os::vm_page_size() - BytesPerWord, "SafepointPollOffset");
2344 #endif 2392 #endif
2345 2393
2691 FLAG_SET_CMDLINE(uintx, MaxHeapSize, (uintx)long_max_heap_size); 2739 FLAG_SET_CMDLINE(uintx, MaxHeapSize, (uintx)long_max_heap_size);
2692 // Xmaxf 2740 // Xmaxf
2693 } else if (match_option(option, "-Xmaxf", &tail)) { 2741 } else if (match_option(option, "-Xmaxf", &tail)) {
2694 char* err; 2742 char* err;
2695 int maxf = (int)(strtod(tail, &err) * 100); 2743 int maxf = (int)(strtod(tail, &err) * 100);
2696 if (*err != '\0' || maxf < 0 || maxf > 100) { 2744 if (*err != '\0' || *tail == '\0' || maxf < 0 || maxf > 100) {
2697 jio_fprintf(defaultStream::error_stream(), 2745 jio_fprintf(defaultStream::error_stream(),
2698 "Bad max heap free percentage size: %s\n", 2746 "Bad max heap free percentage size: %s\n",
2699 option->optionString); 2747 option->optionString);
2700 return JNI_EINVAL; 2748 return JNI_EINVAL;
2701 } else { 2749 } else {
2703 } 2751 }
2704 // Xminf 2752 // Xminf
2705 } else if (match_option(option, "-Xminf", &tail)) { 2753 } else if (match_option(option, "-Xminf", &tail)) {
2706 char* err; 2754 char* err;
2707 int minf = (int)(strtod(tail, &err) * 100); 2755 int minf = (int)(strtod(tail, &err) * 100);
2708 if (*err != '\0' || minf < 0 || minf > 100) { 2756 if (*err != '\0' || *tail == '\0' || minf < 0 || minf > 100) {
2709 jio_fprintf(defaultStream::error_stream(), 2757 jio_fprintf(defaultStream::error_stream(),
2710 "Bad min heap free percentage size: %s\n", 2758 "Bad min heap free percentage size: %s\n",
2711 option->optionString); 2759 option->optionString);
2712 return JNI_EINVAL; 2760 return JNI_EINVAL;
2713 } else { 2761 } else {
3648 3696
3649 #if INCLUDE_ALL_GCS 3697 #if INCLUDE_ALL_GCS
3650 // Set per-collector flags 3698 // Set per-collector flags
3651 if (UseParallelGC || UseParallelOldGC) { 3699 if (UseParallelGC || UseParallelOldGC) {
3652 set_parallel_gc_flags(); 3700 set_parallel_gc_flags();
3653 } else if (UseConcMarkSweepGC) { // should be done before ParNew check below 3701 } else if (UseConcMarkSweepGC) { // Should be done before ParNew check below
3654 set_cms_and_parnew_gc_flags(); 3702 set_cms_and_parnew_gc_flags();
3655 } else if (UseParNewGC) { // skipped if CMS is set above 3703 } else if (UseParNewGC) { // Skipped if CMS is set above
3656 set_parnew_gc_flags(); 3704 set_parnew_gc_flags();
3657 } else if (UseG1GC) { 3705 } else if (UseG1GC) {
3658 set_g1_gc_flags(); 3706 set_g1_gc_flags();
3659 } 3707 }
3660 check_deprecated_gcs(); 3708 check_deprecated_gcs();
3663 if (FLAG_IS_DEFAULT(ParallelGCThreads) && ParallelGCThreads == 1) { 3711 if (FLAG_IS_DEFAULT(ParallelGCThreads) && ParallelGCThreads == 1) {
3664 warning("If the number of processors is expected to increase from one, then" 3712 warning("If the number of processors is expected to increase from one, then"
3665 " you should configure the number of parallel GC threads appropriately" 3713 " you should configure the number of parallel GC threads appropriately"
3666 " using -XX:ParallelGCThreads=N"); 3714 " using -XX:ParallelGCThreads=N");
3667 } 3715 }
3716 }
3717 if (MinHeapFreeRatio == 100) {
3718 // Keeping the heap 100% free is hard ;-) so limit it to 99%.
3719 FLAG_SET_ERGO(uintx, MinHeapFreeRatio, 99);
3668 } 3720 }
3669 #else // INCLUDE_ALL_GCS 3721 #else // INCLUDE_ALL_GCS
3670 assert(verify_serial_gc_flags(), "SerialGC unset"); 3722 assert(verify_serial_gc_flags(), "SerialGC unset");
3671 #endif // INCLUDE_ALL_GCS 3723 #endif // INCLUDE_ALL_GCS
3672 3724
3694 "; ignoring UseBiasedLocking flag." ); 3746 "; ignoring UseBiasedLocking flag." );
3695 } 3747 }
3696 UseBiasedLocking = false; 3748 UseBiasedLocking = false;
3697 } 3749 }
3698 3750
3699 #ifdef CC_INTERP 3751 #ifdef ZERO
3700 // Clear flags not supported by the C++ interpreter 3752 // Clear flags not supported on zero.
3701 FLAG_SET_DEFAULT(ProfileInterpreter, false); 3753 FLAG_SET_DEFAULT(ProfileInterpreter, false);
3702 FLAG_SET_DEFAULT(UseBiasedLocking, false); 3754 FLAG_SET_DEFAULT(UseBiasedLocking, false);
3703 LP64_ONLY(FLAG_SET_DEFAULT(UseCompressedOops, false)); 3755 LP64_ONLY(FLAG_SET_DEFAULT(UseCompressedOops, false));
3704 LP64_ONLY(FLAG_SET_DEFAULT(UseCompressedClassPointers, false)); 3756 LP64_ONLY(FLAG_SET_DEFAULT(UseCompressedClassPointers, false));
3705 #endif // CC_INTERP 3757 #endif // CC_INTERP
3706 3758
3707 #ifdef COMPILER2 3759 #ifdef COMPILER2
3708 if (!UseBiasedLocking || EmitSync != 0) {
3709 UseOptoBiasInlining = false;
3710 }
3711 if (!EliminateLocks) { 3760 if (!EliminateLocks) {
3712 EliminateNestedLocks = false; 3761 EliminateNestedLocks = false;
3713 } 3762 }
3714 if (!Inline) { 3763 if (!Inline) {
3715 IncrementalInline = false; 3764 IncrementalInline = false;
3729 } 3778 }
3730 if (UseTypeSpeculation && FLAG_IS_DEFAULT(ReplaceInParentMaps)) { 3779 if (UseTypeSpeculation && FLAG_IS_DEFAULT(ReplaceInParentMaps)) {
3731 // Doing the replace in parent maps helps speculation 3780 // Doing the replace in parent maps helps speculation
3732 FLAG_SET_DEFAULT(ReplaceInParentMaps, true); 3781 FLAG_SET_DEFAULT(ReplaceInParentMaps, true);
3733 } 3782 }
3734 #ifndef X86
3735 // Only on x86 for now
3736 FLAG_SET_DEFAULT(TypeProfileLevel, 0);
3737 #endif
3738 #endif 3783 #endif
3739 3784
3740 if (PrintAssembly && FLAG_IS_DEFAULT(DebugNonSafepoints)) { 3785 if (PrintAssembly && FLAG_IS_DEFAULT(DebugNonSafepoints)) {
3741 warning("PrintAssembly is enabled; turning on DebugNonSafepoints to gain additional output"); 3786 warning("PrintAssembly is enabled; turning on DebugNonSafepoints to gain additional output");
3742 DebugNonSafepoints = true; 3787 DebugNonSafepoints = true;
3770 if (!VM_Version::use_biased_locking() && 3815 if (!VM_Version::use_biased_locking() &&
3771 !(FLAG_IS_CMDLINE(UseBiasedLocking))) { 3816 !(FLAG_IS_CMDLINE(UseBiasedLocking))) {
3772 UseBiasedLocking = false; 3817 UseBiasedLocking = false;
3773 } 3818 }
3774 } 3819 }
3820 #ifdef COMPILER2
3821 if (!UseBiasedLocking || EmitSync != 0) {
3822 UseOptoBiasInlining = false;
3823 }
3824 #endif
3775 3825
3776 // set PauseAtExit if the gamma launcher was used and a debugger is attached 3826 // set PauseAtExit if the gamma launcher was used and a debugger is attached
3777 // but only if not already set on the commandline 3827 // but only if not already set on the commandline
3778 if (Arguments::created_by_gamma_launcher() && os::is_debugger_attached()) { 3828 if (Arguments::created_by_gamma_launcher() && os::is_debugger_attached()) {
3779 bool set = false; 3829 bool set = false;