1289 // promote all objects surviving "tenuring_default" scavenges.
1290 if (FLAG_IS_DEFAULT(MaxTenuringThreshold) &&
1291 FLAG_IS_DEFAULT(SurvivorRatio)) {
1292 FLAG_SET_ERGO(uintx, MaxTenuringThreshold, tenuring_default);
1293 }
1294 // If we decided above (or user explicitly requested)
1295 // `promote all' (via MaxTenuringThreshold := 0),
1296 // prefer minuscule survivor spaces so as not to waste
1297 // space for (non-existent) survivors
1298 if (FLAG_IS_DEFAULT(SurvivorRatio) && MaxTenuringThreshold == 0) {
1299 FLAG_SET_ERGO(uintx, SurvivorRatio, MAX2((uintx)1024, SurvivorRatio));
1300 }
1301 // If OldPLABSize is set and CMSParPromoteBlocksToClaim is not,
1302 // set CMSParPromoteBlocksToClaim equal to OldPLABSize.
1303 // This is done in order to make ParNew+CMS configuration to work
1304 // with YoungPLABSize and OldPLABSize options.
1305 // See CR 6362902.
1306 if (!FLAG_IS_DEFAULT(OldPLABSize)) {
1307 if (FLAG_IS_DEFAULT(CMSParPromoteBlocksToClaim)) {
1308 // OldPLABSize is not the default value but CMSParPromoteBlocksToClaim
1309 // is. In this situtation let CMSParPromoteBlocksToClaim follow
1310 // the value (either from the command line or ergonomics) of
1311 // OldPLABSize. Following OldPLABSize is an ergonomics decision.
1312 FLAG_SET_ERGO(uintx, CMSParPromoteBlocksToClaim, OldPLABSize);
1313 } else {
1314 // OldPLABSize and CMSParPromoteBlocksToClaim are both set.
1315 // CMSParPromoteBlocksToClaim is a collector-specific flag, so
1316 // we'll let it to take precedence.
1317 jio_fprintf(defaultStream::error_stream(),
1318 "Both OldPLABSize and CMSParPromoteBlocksToClaim"
1319 " options are specified for the CMS collector."
1320 " CMSParPromoteBlocksToClaim will take precedence.\n");
1321 }
1322 }
1323 if (!FLAG_IS_DEFAULT(ResizeOldPLAB) && !ResizeOldPLAB) {
1324 // OldPLAB sizing manually turned off: Use a larger default setting,
1325 // unless it was manually specified. This is because a too-low value
1326 // will slow down scavenges.
1327 if (FLAG_IS_DEFAULT(CMSParPromoteBlocksToClaim)) {
1328 FLAG_SET_ERGO(uintx, CMSParPromoteBlocksToClaim, 50); // default value before 6631166
1329 }
2630 FLAG_SET_CMDLINE(bool, ClassUnloading, false);
2631 // -Xincgc: i-CMS
2632 } else if (match_option(option, "-Xincgc", &tail)) {
2633 FLAG_SET_CMDLINE(bool, UseConcMarkSweepGC, true);
2634 FLAG_SET_CMDLINE(bool, CMSIncrementalMode, true);
2635 // -Xnoincgc: no i-CMS
2636 } else if (match_option(option, "-Xnoincgc", &tail)) {
2637 FLAG_SET_CMDLINE(bool, UseConcMarkSweepGC, false);
2638 FLAG_SET_CMDLINE(bool, CMSIncrementalMode, false);
2639 // -Xconcgc
2640 } else if (match_option(option, "-Xconcgc", &tail)) {
2641 FLAG_SET_CMDLINE(bool, UseConcMarkSweepGC, true);
2642 // -Xnoconcgc
2643 } else if (match_option(option, "-Xnoconcgc", &tail)) {
2644 FLAG_SET_CMDLINE(bool, UseConcMarkSweepGC, false);
2645 // -Xbatch
2646 } else if (match_option(option, "-Xbatch", &tail)) {
2647 FLAG_SET_CMDLINE(bool, BackgroundCompilation, false);
2648 // -Xmn for compatibility with other JVM vendors
2649 } else if (match_option(option, "-Xmn", &tail)) {
2650 julong long_initial_eden_size = 0;
2651 ArgsRange errcode = parse_memory_size(tail, &long_initial_eden_size, 1);
2652 if (errcode != arg_in_range) {
2653 jio_fprintf(defaultStream::error_stream(),
2654 "Invalid initial eden size: %s\n", option->optionString);
2655 describe_range_error(errcode);
2656 return JNI_EINVAL;
2657 }
2658 FLAG_SET_CMDLINE(uintx, MaxNewSize, (uintx)long_initial_eden_size);
2659 FLAG_SET_CMDLINE(uintx, NewSize, (uintx)long_initial_eden_size);
2660 // -Xms
2661 } else if (match_option(option, "-Xms", &tail)) {
2662 julong long_initial_heap_size = 0;
2663 // an initial heap size of 0 means automatically determine
2664 ArgsRange errcode = parse_memory_size(tail, &long_initial_heap_size, 0);
2665 if (errcode != arg_in_range) {
2666 jio_fprintf(defaultStream::error_stream(),
2667 "Invalid initial heap size: %s\n", option->optionString);
2668 describe_range_error(errcode);
2669 return JNI_EINVAL;
2670 }
2671 FLAG_SET_CMDLINE(uintx, InitialHeapSize, (uintx)long_initial_heap_size);
2672 // Currently the minimum size and the initial heap sizes are the same.
2673 set_min_heap_size(InitialHeapSize);
2674 // -Xmx
2675 } else if (match_option(option, "-Xmx", &tail) || match_option(option, "-XX:MaxHeapSize=", &tail)) {
2676 julong long_max_heap_size = 0;
2677 ArgsRange errcode = parse_memory_size(tail, &long_max_heap_size, 1);
2678 if (errcode != arg_in_range) {
2679 jio_fprintf(defaultStream::error_stream(),
|
1289 // promote all objects surviving "tenuring_default" scavenges.
1290 if (FLAG_IS_DEFAULT(MaxTenuringThreshold) &&
1291 FLAG_IS_DEFAULT(SurvivorRatio)) {
1292 FLAG_SET_ERGO(uintx, MaxTenuringThreshold, tenuring_default);
1293 }
1294 // If we decided above (or user explicitly requested)
1295 // `promote all' (via MaxTenuringThreshold := 0),
1296 // prefer minuscule survivor spaces so as not to waste
1297 // space for (non-existent) survivors
1298 if (FLAG_IS_DEFAULT(SurvivorRatio) && MaxTenuringThreshold == 0) {
1299 FLAG_SET_ERGO(uintx, SurvivorRatio, MAX2((uintx)1024, SurvivorRatio));
1300 }
1301 // If OldPLABSize is set and CMSParPromoteBlocksToClaim is not,
1302 // set CMSParPromoteBlocksToClaim equal to OldPLABSize.
1303 // This is done in order to make ParNew+CMS configuration to work
1304 // with YoungPLABSize and OldPLABSize options.
1305 // See CR 6362902.
1306 if (!FLAG_IS_DEFAULT(OldPLABSize)) {
1307 if (FLAG_IS_DEFAULT(CMSParPromoteBlocksToClaim)) {
1308 // OldPLABSize is not the default value but CMSParPromoteBlocksToClaim
1309 // is. In this situation let CMSParPromoteBlocksToClaim follow
1310 // the value (either from the command line or ergonomics) of
1311 // OldPLABSize. Following OldPLABSize is an ergonomics decision.
1312 FLAG_SET_ERGO(uintx, CMSParPromoteBlocksToClaim, OldPLABSize);
1313 } else {
1314 // OldPLABSize and CMSParPromoteBlocksToClaim are both set.
1315 // CMSParPromoteBlocksToClaim is a collector-specific flag, so
1316 // we'll let it to take precedence.
1317 jio_fprintf(defaultStream::error_stream(),
1318 "Both OldPLABSize and CMSParPromoteBlocksToClaim"
1319 " options are specified for the CMS collector."
1320 " CMSParPromoteBlocksToClaim will take precedence.\n");
1321 }
1322 }
1323 if (!FLAG_IS_DEFAULT(ResizeOldPLAB) && !ResizeOldPLAB) {
1324 // OldPLAB sizing manually turned off: Use a larger default setting,
1325 // unless it was manually specified. This is because a too-low value
1326 // will slow down scavenges.
1327 if (FLAG_IS_DEFAULT(CMSParPromoteBlocksToClaim)) {
1328 FLAG_SET_ERGO(uintx, CMSParPromoteBlocksToClaim, 50); // default value before 6631166
1329 }
2630 FLAG_SET_CMDLINE(bool, ClassUnloading, false);
2631 // -Xincgc: i-CMS
2632 } else if (match_option(option, "-Xincgc", &tail)) {
2633 FLAG_SET_CMDLINE(bool, UseConcMarkSweepGC, true);
2634 FLAG_SET_CMDLINE(bool, CMSIncrementalMode, true);
2635 // -Xnoincgc: no i-CMS
2636 } else if (match_option(option, "-Xnoincgc", &tail)) {
2637 FLAG_SET_CMDLINE(bool, UseConcMarkSweepGC, false);
2638 FLAG_SET_CMDLINE(bool, CMSIncrementalMode, false);
2639 // -Xconcgc
2640 } else if (match_option(option, "-Xconcgc", &tail)) {
2641 FLAG_SET_CMDLINE(bool, UseConcMarkSweepGC, true);
2642 // -Xnoconcgc
2643 } else if (match_option(option, "-Xnoconcgc", &tail)) {
2644 FLAG_SET_CMDLINE(bool, UseConcMarkSweepGC, false);
2645 // -Xbatch
2646 } else if (match_option(option, "-Xbatch", &tail)) {
2647 FLAG_SET_CMDLINE(bool, BackgroundCompilation, false);
2648 // -Xmn for compatibility with other JVM vendors
2649 } else if (match_option(option, "-Xmn", &tail)) {
2650 julong long_initial_young_size = 0;
2651 ArgsRange errcode = parse_memory_size(tail, &long_initial_young_size, 1);
2652 if (errcode != arg_in_range) {
2653 jio_fprintf(defaultStream::error_stream(),
2654 "Invalid initial young generation size: %s\n", option->optionString);
2655 describe_range_error(errcode);
2656 return JNI_EINVAL;
2657 }
2658 FLAG_SET_CMDLINE(uintx, MaxNewSize, (uintx)long_initial_young_size);
2659 FLAG_SET_CMDLINE(uintx, NewSize, (uintx)long_initial_young_size);
2660 // -Xms
2661 } else if (match_option(option, "-Xms", &tail)) {
2662 julong long_initial_heap_size = 0;
2663 // an initial heap size of 0 means automatically determine
2664 ArgsRange errcode = parse_memory_size(tail, &long_initial_heap_size, 0);
2665 if (errcode != arg_in_range) {
2666 jio_fprintf(defaultStream::error_stream(),
2667 "Invalid initial heap size: %s\n", option->optionString);
2668 describe_range_error(errcode);
2669 return JNI_EINVAL;
2670 }
2671 FLAG_SET_CMDLINE(uintx, InitialHeapSize, (uintx)long_initial_heap_size);
2672 // Currently the minimum size and the initial heap sizes are the same.
2673 set_min_heap_size(InitialHeapSize);
2674 // -Xmx
2675 } else if (match_option(option, "-Xmx", &tail) || match_option(option, "-XX:MaxHeapSize=", &tail)) {
2676 julong long_max_heap_size = 0;
2677 ArgsRange errcode = parse_memory_size(tail, &long_max_heap_size, 1);
2678 if (errcode != arg_in_range) {
2679 jio_fprintf(defaultStream::error_stream(),
|