hotspot/src/share/vm/runtime/arguments.cpp
changeset 29697 92501504191b
parent 29696 01571dfab5be
child 30120 af79e35d33e1
child 30201 cfe623bb3f9c
child 29870 ea8305ce32fa
equal deleted inserted replaced
29696:01571dfab5be 29697:92501504191b
    65     }                                                                 \
    65     }                                                                 \
    66     FLAG_SET_DEFAULT(gc, false);                                      \
    66     FLAG_SET_DEFAULT(gc, false);                                      \
    67   }                                                                   \
    67   }                                                                   \
    68 } while(0)
    68 } while(0)
    69 
    69 
    70 char**  Arguments::_jvm_flags_array             = NULL;
    70 char** Arguments::_jvm_flags_array              = NULL;
    71 int     Arguments::_num_jvm_flags               = 0;
    71 int    Arguments::_num_jvm_flags                = 0;
    72 char**  Arguments::_jvm_args_array              = NULL;
    72 char** Arguments::_jvm_args_array               = NULL;
    73 int     Arguments::_num_jvm_args                = 0;
    73 int    Arguments::_num_jvm_args                 = 0;
    74 char*  Arguments::_java_command                 = NULL;
    74 char*  Arguments::_java_command                 = NULL;
    75 SystemProperty* Arguments::_system_properties   = NULL;
    75 SystemProperty* Arguments::_system_properties   = NULL;
    76 const char*  Arguments::_gc_log_filename        = NULL;
    76 const char*  Arguments::_gc_log_filename        = NULL;
    77 bool   Arguments::_has_profile                  = false;
    77 bool   Arguments::_has_profile                  = false;
    78 size_t Arguments::_conservative_max_heap_alignment = 0;
    78 size_t Arguments::_conservative_max_heap_alignment = 0;
    79 uintx  Arguments::_min_heap_size                = 0;
    79 size_t Arguments::_min_heap_size                = 0;
    80 uintx  Arguments::_min_heap_free_ratio          = 0;
    80 uintx  Arguments::_min_heap_free_ratio          = 0;
    81 uintx  Arguments::_max_heap_free_ratio          = 0;
    81 uintx  Arguments::_max_heap_free_ratio          = 0;
    82 Arguments::Mode Arguments::_mode                = _mixed;
    82 Arguments::Mode Arguments::_mode                = _mixed;
    83 bool   Arguments::_java_compiler                = false;
    83 bool   Arguments::_java_compiler                = false;
    84 bool   Arguments::_xdebug_mode                  = false;
    84 bool   Arguments::_xdebug_mode                  = false;
  1341 
  1341 
  1342     // Set MaxNewSize to our calculated preferred_max_new_size unless
  1342     // Set MaxNewSize to our calculated preferred_max_new_size unless
  1343     // NewSize was set on the command line and it is larger than
  1343     // NewSize was set on the command line and it is larger than
  1344     // preferred_max_new_size.
  1344     // preferred_max_new_size.
  1345     if (!FLAG_IS_DEFAULT(NewSize)) {   // NewSize explicitly set at command-line
  1345     if (!FLAG_IS_DEFAULT(NewSize)) {   // NewSize explicitly set at command-line
  1346       FLAG_SET_ERGO(uintx, MaxNewSize, MAX2(NewSize, preferred_max_new_size));
  1346       FLAG_SET_ERGO(size_t, MaxNewSize, MAX2(NewSize, preferred_max_new_size));
  1347     } else {
  1347     } else {
  1348       FLAG_SET_ERGO(uintx, MaxNewSize, preferred_max_new_size);
  1348       FLAG_SET_ERGO(size_t, MaxNewSize, preferred_max_new_size);
  1349     }
  1349     }
  1350     if (PrintGCDetails && Verbose) {
  1350     if (PrintGCDetails && Verbose) {
  1351       // Too early to use gclog_or_tty
  1351       // Too early to use gclog_or_tty
  1352       tty->print_cr("CMS ergo set MaxNewSize: " SIZE_FORMAT, MaxNewSize);
  1352       tty->print_cr("CMS ergo set MaxNewSize: " SIZE_FORMAT, MaxNewSize);
  1353     }
  1353     }
  1366     }
  1366     }
  1367     if (max_heap > min_new && min_heap_size() > min_new) {
  1367     if (max_heap > min_new && min_heap_size() > min_new) {
  1368       // Unless explicitly requested otherwise, make young gen
  1368       // Unless explicitly requested otherwise, make young gen
  1369       // at least min_new, and at most preferred_max_new_size.
  1369       // at least min_new, and at most preferred_max_new_size.
  1370       if (FLAG_IS_DEFAULT(NewSize)) {
  1370       if (FLAG_IS_DEFAULT(NewSize)) {
  1371         FLAG_SET_ERGO(uintx, NewSize, MAX2(NewSize, min_new));
  1371         FLAG_SET_ERGO(size_t, NewSize, MAX2(NewSize, min_new));
  1372         FLAG_SET_ERGO(uintx, NewSize, MIN2(preferred_max_new_size, NewSize));
  1372         FLAG_SET_ERGO(size_t, NewSize, MIN2(preferred_max_new_size, NewSize));
  1373         if (PrintGCDetails && Verbose) {
  1373         if (PrintGCDetails && Verbose) {
  1374           // Too early to use gclog_or_tty
  1374           // Too early to use gclog_or_tty
  1375           tty->print_cr("CMS ergo set NewSize: " SIZE_FORMAT, NewSize);
  1375           tty->print_cr("CMS ergo set NewSize: " SIZE_FORMAT, NewSize);
  1376         }
  1376         }
  1377       }
  1377       }
  1378       // Unless explicitly requested otherwise, size old gen
  1378       // Unless explicitly requested otherwise, size old gen
  1379       // so it's NewRatio x of NewSize.
  1379       // so it's NewRatio x of NewSize.
  1380       if (FLAG_IS_DEFAULT(OldSize)) {
  1380       if (FLAG_IS_DEFAULT(OldSize)) {
  1381         if (max_heap > NewSize) {
  1381         if (max_heap > NewSize) {
  1382           FLAG_SET_ERGO(uintx, OldSize, MIN2(NewRatio*NewSize, max_heap - NewSize));
  1382           FLAG_SET_ERGO(size_t, OldSize, MIN2(NewRatio*NewSize, max_heap - NewSize));
  1383           if (PrintGCDetails && Verbose) {
  1383           if (PrintGCDetails && Verbose) {
  1384             // Too early to use gclog_or_tty
  1384             // Too early to use gclog_or_tty
  1385             tty->print_cr("CMS ergo set OldSize: " SIZE_FORMAT, OldSize);
  1385             tty->print_cr("CMS ergo set OldSize: " SIZE_FORMAT, OldSize);
  1386           }
  1386           }
  1387         }
  1387         }
  1408   if (FLAG_IS_DEFAULT(OldPLABSize)) {
  1408   if (FLAG_IS_DEFAULT(OldPLABSize)) {
  1409     if (!FLAG_IS_DEFAULT(ResizeOldPLAB) && !ResizeOldPLAB) {
  1409     if (!FLAG_IS_DEFAULT(ResizeOldPLAB) && !ResizeOldPLAB) {
  1410       // OldPLAB sizing manually turned off: Use a larger default setting,
  1410       // OldPLAB sizing manually turned off: Use a larger default setting,
  1411       // unless it was manually specified. This is because a too-low value
  1411       // unless it was manually specified. This is because a too-low value
  1412       // will slow down scavenges.
  1412       // will slow down scavenges.
  1413       FLAG_SET_ERGO(uintx, OldPLABSize, CFLS_LAB::_default_static_old_plab_size); // default value before 6631166
  1413       FLAG_SET_ERGO(size_t, OldPLABSize, CFLS_LAB::_default_static_old_plab_size); // default value before 6631166
  1414     } else {
  1414     } else {
  1415       FLAG_SET_DEFAULT(OldPLABSize, CFLS_LAB::_default_dynamic_old_plab_size); // old CMSParPromoteBlocksToClaim default
  1415       FLAG_SET_DEFAULT(OldPLABSize, CFLS_LAB::_default_dynamic_old_plab_size); // old CMSParPromoteBlocksToClaim default
  1416     }
  1416     }
  1417   }
  1417   }
  1418 
  1418 
  1788   }
  1788   }
  1789   return result;
  1789   return result;
  1790 }
  1790 }
  1791 
  1791 
  1792 // Use static initialization to get the default before parsing
  1792 // Use static initialization to get the default before parsing
  1793 static const uintx DefaultHeapBaseMinAddress = HeapBaseMinAddress;
  1793 static const size_t DefaultHeapBaseMinAddress = HeapBaseMinAddress;
  1794 
  1794 
  1795 void Arguments::set_heap_size() {
  1795 void Arguments::set_heap_size() {
  1796   if (!FLAG_IS_DEFAULT(DefaultMaxRAMFraction)) {
  1796   if (!FLAG_IS_DEFAULT(DefaultMaxRAMFraction)) {
  1797     // Deprecated flag
  1797     // Deprecated flag
  1798     FLAG_SET_CMDLINE(uintx, MaxRAMFraction, DefaultMaxRAMFraction);
  1798     FLAG_SET_CMDLINE(uintx, MaxRAMFraction, DefaultMaxRAMFraction);
  1828       if (!FLAG_IS_DEFAULT(HeapBaseMinAddress)) {
  1828       if (!FLAG_IS_DEFAULT(HeapBaseMinAddress)) {
  1829         if (HeapBaseMinAddress < DefaultHeapBaseMinAddress) {
  1829         if (HeapBaseMinAddress < DefaultHeapBaseMinAddress) {
  1830           // matches compressed oops printing flags
  1830           // matches compressed oops printing flags
  1831           if (PrintCompressedOopsMode || (PrintMiscellaneous && Verbose)) {
  1831           if (PrintCompressedOopsMode || (PrintMiscellaneous && Verbose)) {
  1832             jio_fprintf(defaultStream::error_stream(),
  1832             jio_fprintf(defaultStream::error_stream(),
  1833                         "HeapBaseMinAddress must be at least " UINTX_FORMAT
  1833                         "HeapBaseMinAddress must be at least " SIZE_FORMAT
  1834                         " (" UINTX_FORMAT "G) which is greater than value given "
  1834                         " (" SIZE_FORMAT "G) which is greater than value given "
  1835                         UINTX_FORMAT "\n",
  1835                         SIZE_FORMAT "\n",
  1836                         DefaultHeapBaseMinAddress,
  1836                         DefaultHeapBaseMinAddress,
  1837                         DefaultHeapBaseMinAddress/G,
  1837                         DefaultHeapBaseMinAddress/G,
  1838                         HeapBaseMinAddress);
  1838                         HeapBaseMinAddress);
  1839           }
  1839           }
  1840           FLAG_SET_ERGO(uintx, HeapBaseMinAddress, DefaultHeapBaseMinAddress);
  1840           FLAG_SET_ERGO(size_t, HeapBaseMinAddress, DefaultHeapBaseMinAddress);
  1841         }
  1841         }
  1842       }
  1842       }
  1843 
  1843 
  1844       if (HeapBaseMinAddress + MaxHeapSize < max_coop_heap) {
  1844       if (HeapBaseMinAddress + MaxHeapSize < max_coop_heap) {
  1845         // Heap should be above HeapBaseMinAddress to get zero based compressed oops
  1845         // Heap should be above HeapBaseMinAddress to get zero based compressed oops
  1860 
  1860 
  1861     if (PrintGCDetails && Verbose) {
  1861     if (PrintGCDetails && Verbose) {
  1862       // Cannot use gclog_or_tty yet.
  1862       // Cannot use gclog_or_tty yet.
  1863       tty->print_cr("  Maximum heap size " SIZE_FORMAT, (size_t) reasonable_max);
  1863       tty->print_cr("  Maximum heap size " SIZE_FORMAT, (size_t) reasonable_max);
  1864     }
  1864     }
  1865     FLAG_SET_ERGO(uintx, MaxHeapSize, (uintx)reasonable_max);
  1865     FLAG_SET_ERGO(size_t, MaxHeapSize, (size_t)reasonable_max);
  1866   }
  1866   }
  1867 
  1867 
  1868   // If the minimum or initial heap_size have not been set or requested to be set
  1868   // If the minimum or initial heap_size have not been set or requested to be set
  1869   // ergonomically, set them accordingly.
  1869   // ergonomically, set them accordingly.
  1870   if (InitialHeapSize == 0 || min_heap_size() == 0) {
  1870   if (InitialHeapSize == 0 || min_heap_size() == 0) {
  1882 
  1882 
  1883       reasonable_initial = limit_by_allocatable_memory(reasonable_initial);
  1883       reasonable_initial = limit_by_allocatable_memory(reasonable_initial);
  1884 
  1884 
  1885       if (PrintGCDetails && Verbose) {
  1885       if (PrintGCDetails && Verbose) {
  1886         // Cannot use gclog_or_tty yet.
  1886         // Cannot use gclog_or_tty yet.
  1887         tty->print_cr("  Initial heap size " SIZE_FORMAT, (uintx)reasonable_initial);
  1887         tty->print_cr("  Initial heap size " SIZE_FORMAT, (size_t)reasonable_initial);
  1888       }
  1888       }
  1889       FLAG_SET_ERGO(uintx, InitialHeapSize, (uintx)reasonable_initial);
  1889       FLAG_SET_ERGO(size_t, InitialHeapSize, (size_t)reasonable_initial);
  1890     }
  1890     }
  1891     // If the minimum heap size has not been set (via -Xms),
  1891     // If the minimum heap size has not been set (via -Xms),
  1892     // synchronize with InitialHeapSize to avoid errors with the default value.
  1892     // synchronize with InitialHeapSize to avoid errors with the default value.
  1893     if (min_heap_size() == 0) {
  1893     if (min_heap_size() == 0) {
  1894       set_min_heap_size(MIN2((uintx)reasonable_minimum, InitialHeapSize));
  1894       set_min_heap_size(MIN2((size_t)reasonable_minimum, InitialHeapSize));
  1895       if (PrintGCDetails && Verbose) {
  1895       if (PrintGCDetails && Verbose) {
  1896         // Cannot use gclog_or_tty yet.
  1896         // Cannot use gclog_or_tty yet.
  1897         tty->print_cr("  Minimum heap size " SIZE_FORMAT, min_heap_size());
  1897         tty->print_cr("  Minimum heap size " SIZE_FORMAT, min_heap_size());
  1898       }
  1898       }
  1899     }
  1899     }
  2035       UseGCLogFileRotation = false;
  2035       UseGCLogFileRotation = false;
  2036     }
  2036     }
  2037   }
  2037   }
  2038 
  2038 
  2039   if (UseGCLogFileRotation && (GCLogFileSize != 0) && (GCLogFileSize < 8*K)) {
  2039   if (UseGCLogFileRotation && (GCLogFileSize != 0) && (GCLogFileSize < 8*K)) {
  2040     FLAG_SET_CMDLINE(uintx, GCLogFileSize, 8*K);
  2040     FLAG_SET_CMDLINE(size_t, GCLogFileSize, 8*K);
  2041     jio_fprintf(defaultStream::output_stream(),
  2041     jio_fprintf(defaultStream::output_stream(),
  2042                 "GCLogFileSize changed to minimum 8K\n");
  2042                 "GCLogFileSize changed to minimum 8K\n");
  2043   }
  2043   }
  2044 }
  2044 }
  2045 
  2045 
  2392                                   1, (max_jint - 1), "MarkStackSizeMax");
  2392                                   1, (max_jint - 1), "MarkStackSizeMax");
  2393   status = status && verify_interval(NUMAChunkResizeWeight, 0, 100, "NUMAChunkResizeWeight");
  2393   status = status && verify_interval(NUMAChunkResizeWeight, 0, 100, "NUMAChunkResizeWeight");
  2394 
  2394 
  2395   status = status && verify_min_value(LogEventsBufferEntries, 1, "LogEventsBufferEntries");
  2395   status = status && verify_min_value(LogEventsBufferEntries, 1, "LogEventsBufferEntries");
  2396 
  2396 
  2397   status = status && verify_min_value(HeapSizePerGCThread, (uintx) os::vm_page_size(), "HeapSizePerGCThread");
  2397   status = status && verify_min_value(HeapSizePerGCThread, (size_t) os::vm_page_size(), "HeapSizePerGCThread");
  2398 
  2398 
  2399   status = status && verify_min_value(GCTaskTimeStampEntries, 1, "GCTaskTimeStampEntries");
  2399   status = status && verify_min_value(GCTaskTimeStampEntries, 1, "GCTaskTimeStampEntries");
  2400 
  2400 
  2401   status = status && verify_percentage(ParallelGCBufferWastePct, "ParallelGCBufferWastePct");
  2401   status = status && verify_percentage(ParallelGCBufferWastePct, "ParallelGCBufferWastePct");
  2402   status = status && verify_interval(TargetPLABWastePct, 1, 100, "TargetPLABWastePct");
  2402   status = status && verify_interval(TargetPLABWastePct, 1, 100, "TargetPLABWastePct");
  2807         jio_fprintf(defaultStream::error_stream(),
  2807         jio_fprintf(defaultStream::error_stream(),
  2808                     "Invalid initial young generation size: %s\n", option->optionString);
  2808                     "Invalid initial young generation size: %s\n", option->optionString);
  2809         describe_range_error(errcode);
  2809         describe_range_error(errcode);
  2810         return JNI_EINVAL;
  2810         return JNI_EINVAL;
  2811       }
  2811       }
  2812       FLAG_SET_CMDLINE(uintx, MaxNewSize, (uintx)long_initial_young_size);
  2812       FLAG_SET_CMDLINE(size_t, MaxNewSize, (size_t)long_initial_young_size);
  2813       FLAG_SET_CMDLINE(uintx, NewSize, (uintx)long_initial_young_size);
  2813       FLAG_SET_CMDLINE(size_t, NewSize, (size_t)long_initial_young_size);
  2814     // -Xms
  2814     // -Xms
  2815     } else if (match_option(option, "-Xms", &tail)) {
  2815     } else if (match_option(option, "-Xms", &tail)) {
  2816       julong long_initial_heap_size = 0;
  2816       julong long_initial_heap_size = 0;
  2817       // an initial heap size of 0 means automatically determine
  2817       // an initial heap size of 0 means automatically determine
  2818       ArgsRange errcode = parse_memory_size(tail, &long_initial_heap_size, 0);
  2818       ArgsRange errcode = parse_memory_size(tail, &long_initial_heap_size, 0);
  2820         jio_fprintf(defaultStream::error_stream(),
  2820         jio_fprintf(defaultStream::error_stream(),
  2821                     "Invalid initial heap size: %s\n", option->optionString);
  2821                     "Invalid initial heap size: %s\n", option->optionString);
  2822         describe_range_error(errcode);
  2822         describe_range_error(errcode);
  2823         return JNI_EINVAL;
  2823         return JNI_EINVAL;
  2824       }
  2824       }
  2825       set_min_heap_size((uintx)long_initial_heap_size);
  2825       set_min_heap_size((size_t)long_initial_heap_size);
  2826       // Currently the minimum size and the initial heap sizes are the same.
  2826       // Currently the minimum size and the initial heap sizes are the same.
  2827       // Can be overridden with -XX:InitialHeapSize.
  2827       // Can be overridden with -XX:InitialHeapSize.
  2828       FLAG_SET_CMDLINE(uintx, InitialHeapSize, (uintx)long_initial_heap_size);
  2828       FLAG_SET_CMDLINE(size_t, InitialHeapSize, (size_t)long_initial_heap_size);
  2829     // -Xmx
  2829     // -Xmx
  2830     } else if (match_option(option, "-Xmx", &tail) || match_option(option, "-XX:MaxHeapSize=", &tail)) {
  2830     } else if (match_option(option, "-Xmx", &tail) || match_option(option, "-XX:MaxHeapSize=", &tail)) {
  2831       julong long_max_heap_size = 0;
  2831       julong long_max_heap_size = 0;
  2832       ArgsRange errcode = parse_memory_size(tail, &long_max_heap_size, 1);
  2832       ArgsRange errcode = parse_memory_size(tail, &long_max_heap_size, 1);
  2833       if (errcode != arg_in_range) {
  2833       if (errcode != arg_in_range) {
  2834         jio_fprintf(defaultStream::error_stream(),
  2834         jio_fprintf(defaultStream::error_stream(),
  2835                     "Invalid maximum heap size: %s\n", option->optionString);
  2835                     "Invalid maximum heap size: %s\n", option->optionString);
  2836         describe_range_error(errcode);
  2836         describe_range_error(errcode);
  2837         return JNI_EINVAL;
  2837         return JNI_EINVAL;
  2838       }
  2838       }
  2839       FLAG_SET_CMDLINE(uintx, MaxHeapSize, (uintx)long_max_heap_size);
  2839       FLAG_SET_CMDLINE(size_t, MaxHeapSize, (size_t)long_max_heap_size);
  2840     // Xmaxf
  2840     // Xmaxf
  2841     } else if (match_option(option, "-Xmaxf", &tail)) {
  2841     } else if (match_option(option, "-Xmaxf", &tail)) {
  2842       char* err;
  2842       char* err;
  2843       int maxf = (int)(strtod(tail, &err) * 100);
  2843       int maxf = (int)(strtod(tail, &err) * 100);
  2844       if (*err != '\0' || *tail == '\0' || maxf < 0 || maxf > 100) {
  2844       if (*err != '\0' || *tail == '\0' || maxf < 0 || maxf > 100) {
  2975     } else if (match_option(option, "-Xconcurrentio")) {
  2975     } else if (match_option(option, "-Xconcurrentio")) {
  2976       FLAG_SET_CMDLINE(bool, UseLWPSynchronization, true);
  2976       FLAG_SET_CMDLINE(bool, UseLWPSynchronization, true);
  2977       FLAG_SET_CMDLINE(bool, BackgroundCompilation, false);
  2977       FLAG_SET_CMDLINE(bool, BackgroundCompilation, false);
  2978       FLAG_SET_CMDLINE(intx, DeferThrSuspendLoopCount, 1);
  2978       FLAG_SET_CMDLINE(intx, DeferThrSuspendLoopCount, 1);
  2979       FLAG_SET_CMDLINE(bool, UseTLAB, false);
  2979       FLAG_SET_CMDLINE(bool, UseTLAB, false);
  2980       FLAG_SET_CMDLINE(uintx, NewSizeThreadIncrease, 16 * K);  // 20Kb per thread added to new generation
  2980       FLAG_SET_CMDLINE(size_t, NewSizeThreadIncrease, 16 * K);  // 20Kb per thread added to new generation
  2981 
  2981 
  2982       // -Xinternalversion
  2982       // -Xinternalversion
  2983     } else if (match_option(option, "-Xinternalversion")) {
  2983     } else if (match_option(option, "-Xinternalversion")) {
  2984       jio_fprintf(defaultStream::output_stream(), "%s\n",
  2984       jio_fprintf(defaultStream::output_stream(), "%s\n",
  2985                   VM_Version::internal_vm_info_string());
  2985                   VM_Version::internal_vm_info_string());
  3136                           total_memory - (julong)160*M);
  3136                           total_memory - (julong)160*M);
  3137 
  3137 
  3138       initHeapSize = limit_by_allocatable_memory(initHeapSize);
  3138       initHeapSize = limit_by_allocatable_memory(initHeapSize);
  3139 
  3139 
  3140       if (FLAG_IS_DEFAULT(MaxHeapSize)) {
  3140       if (FLAG_IS_DEFAULT(MaxHeapSize)) {
  3141          FLAG_SET_CMDLINE(uintx, MaxHeapSize, initHeapSize);
  3141          FLAG_SET_CMDLINE(size_t, MaxHeapSize, initHeapSize);
  3142          FLAG_SET_CMDLINE(uintx, InitialHeapSize, initHeapSize);
  3142          FLAG_SET_CMDLINE(size_t, InitialHeapSize, initHeapSize);
  3143          // Currently the minimum size and the initial heap sizes are the same.
  3143          // Currently the minimum size and the initial heap sizes are the same.
  3144          set_min_heap_size(initHeapSize);
  3144          set_min_heap_size(initHeapSize);
  3145       }
  3145       }
  3146       if (FLAG_IS_DEFAULT(NewSize)) {
  3146       if (FLAG_IS_DEFAULT(NewSize)) {
  3147          // Make the young generation 3/8ths of the total heap.
  3147          // Make the young generation 3/8ths of the total heap.
  3148          FLAG_SET_CMDLINE(uintx, NewSize,
  3148          FLAG_SET_CMDLINE(size_t, NewSize,
  3149                                 ((julong)MaxHeapSize / (julong)8) * (julong)3);
  3149                                 ((julong)MaxHeapSize / (julong)8) * (julong)3);
  3150          FLAG_SET_CMDLINE(uintx, MaxNewSize, NewSize);
  3150          FLAG_SET_CMDLINE(size_t, MaxNewSize, NewSize);
  3151       }
  3151       }
  3152 
  3152 
  3153 #ifndef _ALLBSD_SOURCE  // UseLargePages is not yet supported on BSD.
  3153 #ifndef _ALLBSD_SOURCE  // UseLargePages is not yet supported on BSD.
  3154       FLAG_SET_DEFAULT(UseLargePages, true);
  3154       FLAG_SET_DEFAULT(UseLargePages, true);
  3155 #endif
  3155 #endif
  3156 
  3156 
  3157       // Increase some data structure sizes for efficiency
  3157       // Increase some data structure sizes for efficiency
  3158       FLAG_SET_CMDLINE(uintx, BaseFootPrintEstimate, MaxHeapSize);
  3158       FLAG_SET_CMDLINE(size_t, BaseFootPrintEstimate, MaxHeapSize);
  3159       FLAG_SET_CMDLINE(bool, ResizeTLAB, false);
  3159       FLAG_SET_CMDLINE(bool, ResizeTLAB, false);
  3160       FLAG_SET_CMDLINE(uintx, TLABSize, 256*K);
  3160       FLAG_SET_CMDLINE(size_t, TLABSize, 256*K);
  3161 
  3161 
  3162       // See the OldPLABSize comment below, but replace 'after promotion'
  3162       // See the OldPLABSize comment below, but replace 'after promotion'
  3163       // with 'after copying'.  YoungPLABSize is the size of the survivor
  3163       // with 'after copying'.  YoungPLABSize is the size of the survivor
  3164       // space per-gc-thread buffers.  The default is 4kw.
  3164       // space per-gc-thread buffers.  The default is 4kw.
  3165       FLAG_SET_CMDLINE(uintx, YoungPLABSize, 256*K);      // Note: this is in words
  3165       FLAG_SET_CMDLINE(size_t, YoungPLABSize, 256*K);      // Note: this is in words
  3166 
  3166 
  3167       // OldPLABSize is the size of the buffers in the old gen that
  3167       // OldPLABSize is the size of the buffers in the old gen that
  3168       // UseParallelGC uses to promote live data that doesn't fit in the
  3168       // UseParallelGC uses to promote live data that doesn't fit in the
  3169       // survivor spaces.  At any given time, there's one for each gc thread.
  3169       // survivor spaces.  At any given time, there's one for each gc thread.
  3170       // The default size is 1kw. These buffers are rarely used, since the
  3170       // The default size is 1kw. These buffers are rarely used, since the
  3175       // is that a bigger PLAB results in retaining something like the
  3175       // is that a bigger PLAB results in retaining something like the
  3176       // original allocation order after promotion, which improves mutator
  3176       // original allocation order after promotion, which improves mutator
  3177       // locality.  A minor effect may be that larger PLABs reduce the
  3177       // locality.  A minor effect may be that larger PLABs reduce the
  3178       // number of PLAB allocation events during gc.  The value of 8kw
  3178       // number of PLAB allocation events during gc.  The value of 8kw
  3179       // was arrived at by experimenting with specjbb.
  3179       // was arrived at by experimenting with specjbb.
  3180       FLAG_SET_CMDLINE(uintx, OldPLABSize, 8*K);  // Note: this is in words
  3180       FLAG_SET_CMDLINE(size_t, OldPLABSize, 8*K);  // Note: this is in words
  3181 
  3181 
  3182       // Enable parallel GC and adaptive generation sizing
  3182       // Enable parallel GC and adaptive generation sizing
  3183       FLAG_SET_CMDLINE(bool, UseParallelGC, true);
  3183       FLAG_SET_CMDLINE(bool, UseParallelGC, true);
  3184       FLAG_SET_DEFAULT(ParallelGCThreads,
  3184       FLAG_SET_DEFAULT(ParallelGCThreads,
  3185                        Abstract_VM_Version::parallel_worker_threads());
  3185                        Abstract_VM_Version::parallel_worker_threads());
  3254         return JNI_EINVAL;
  3254         return JNI_EINVAL;
  3255       }
  3255       }
  3256       jio_fprintf(defaultStream::error_stream(),
  3256       jio_fprintf(defaultStream::error_stream(),
  3257         "Please use -XX:MarkStackSize in place of "
  3257         "Please use -XX:MarkStackSize in place of "
  3258         "-XX:CMSMarkStackSize or -XX:G1MarkStackSize in the future\n");
  3258         "-XX:CMSMarkStackSize or -XX:G1MarkStackSize in the future\n");
  3259       FLAG_SET_CMDLINE(uintx, MarkStackSize, stack_size);
  3259       FLAG_SET_CMDLINE(size_t, MarkStackSize, stack_size);
  3260     } else if (match_option(option, "-XX:CMSMarkStackSizeMax=", &tail)) {
  3260     } else if (match_option(option, "-XX:CMSMarkStackSizeMax=", &tail)) {
  3261       julong max_stack_size = 0;
  3261       julong max_stack_size = 0;
  3262       ArgsRange errcode = parse_memory_size(tail, &max_stack_size, 1);
  3262       ArgsRange errcode = parse_memory_size(tail, &max_stack_size, 1);
  3263       if (errcode != arg_in_range) {
  3263       if (errcode != arg_in_range) {
  3264         jio_fprintf(defaultStream::error_stream(),
  3264         jio_fprintf(defaultStream::error_stream(),
  3268         return JNI_EINVAL;
  3268         return JNI_EINVAL;
  3269       }
  3269       }
  3270       jio_fprintf(defaultStream::error_stream(),
  3270       jio_fprintf(defaultStream::error_stream(),
  3271          "Please use -XX:MarkStackSizeMax in place of "
  3271          "Please use -XX:MarkStackSizeMax in place of "
  3272          "-XX:CMSMarkStackSizeMax in the future\n");
  3272          "-XX:CMSMarkStackSizeMax in the future\n");
  3273       FLAG_SET_CMDLINE(uintx, MarkStackSizeMax, max_stack_size);
  3273       FLAG_SET_CMDLINE(size_t, MarkStackSizeMax, max_stack_size);
  3274     } else if (match_option(option, "-XX:ParallelMarkingThreads=", &tail) ||
  3274     } else if (match_option(option, "-XX:ParallelMarkingThreads=", &tail) ||
  3275                match_option(option, "-XX:ParallelCMSThreads=", &tail)) {
  3275                match_option(option, "-XX:ParallelCMSThreads=", &tail)) {
  3276       uintx conc_threads = 0;
  3276       uintx conc_threads = 0;
  3277       if (!parse_uintx(tail, &conc_threads, 1)) {
  3277       if (!parse_uintx(tail, &conc_threads, 1)) {
  3278         jio_fprintf(defaultStream::error_stream(),
  3278         jio_fprintf(defaultStream::error_stream(),
  3291                     "Invalid maximum direct memory size: %s\n",
  3291                     "Invalid maximum direct memory size: %s\n",
  3292                     option->optionString);
  3292                     option->optionString);
  3293         describe_range_error(errcode);
  3293         describe_range_error(errcode);
  3294         return JNI_EINVAL;
  3294         return JNI_EINVAL;
  3295       }
  3295       }
  3296       FLAG_SET_CMDLINE(uintx, MaxDirectMemorySize, max_direct_memory_size);
  3296       FLAG_SET_CMDLINE(size_t, MaxDirectMemorySize, max_direct_memory_size);
  3297 #if !INCLUDE_MANAGEMENT
  3297 #if !INCLUDE_MANAGEMENT
  3298     } else if (match_option(option, "-XX:+ManagementServer")) {
  3298     } else if (match_option(option, "-XX:+ManagementServer")) {
  3299         jio_fprintf(defaultStream::error_stream(),
  3299         jio_fprintf(defaultStream::error_stream(),
  3300           "ManagementServer is not supported in this VM.\n");
  3300           "ManagementServer is not supported in this VM.\n");
  3301         return JNI_ERR;
  3301         return JNI_ERR;