1287 // promote all objects surviving "tenuring_default" scavenges.
1288 if (FLAG_IS_DEFAULT(MaxTenuringThreshold) &&
1289 FLAG_IS_DEFAULT(SurvivorRatio)) {
1290 FLAG_SET_ERGO(uintx, MaxTenuringThreshold, tenuring_default);
1291 }
1292 // If we decided above (or user explicitly requested)
1293 // `promote all' (via MaxTenuringThreshold := 0),
1294 // prefer minuscule survivor spaces so as not to waste
1295 // space for (non-existent) survivors
1296 if (FLAG_IS_DEFAULT(SurvivorRatio) && MaxTenuringThreshold == 0) {
1297 FLAG_SET_ERGO(uintx, SurvivorRatio, MAX2((uintx)1024, SurvivorRatio));
1298 }
1299 // If OldPLABSize is set and CMSParPromoteBlocksToClaim is not,
1300 // set CMSParPromoteBlocksToClaim equal to OldPLABSize.
1301 // This is done in order to make ParNew+CMS configuration to work
1302 // with YoungPLABSize and OldPLABSize options.
1303 // See CR 6362902.
1304 if (!FLAG_IS_DEFAULT(OldPLABSize)) {
1305 if (FLAG_IS_DEFAULT(CMSParPromoteBlocksToClaim)) {
1306 // OldPLABSize is not the default value but CMSParPromoteBlocksToClaim
1307 // is. In this situtation let CMSParPromoteBlocksToClaim follow
1308 // the value (either from the command line or ergonomics) of
1309 // OldPLABSize. Following OldPLABSize is an ergonomics decision.
1310 FLAG_SET_ERGO(uintx, CMSParPromoteBlocksToClaim, OldPLABSize);
1311 } else {
1312 // OldPLABSize and CMSParPromoteBlocksToClaim are both set.
1313 // CMSParPromoteBlocksToClaim is a collector-specific flag, so
1314 // we'll let it to take precedence.
1315 jio_fprintf(defaultStream::error_stream(),
1316 "Both OldPLABSize and CMSParPromoteBlocksToClaim"
1317 " options are specified for the CMS collector."
1318 " CMSParPromoteBlocksToClaim will take precedence.\n");
1319 }
1320 }
1321 if (!FLAG_IS_DEFAULT(ResizeOldPLAB) && !ResizeOldPLAB) {
1322 // OldPLAB sizing manually turned off: Use a larger default setting,
1323 // unless it was manually specified. This is because a too-low value
1324 // will slow down scavenges.
1325 if (FLAG_IS_DEFAULT(CMSParPromoteBlocksToClaim)) {
1326 FLAG_SET_ERGO(uintx, CMSParPromoteBlocksToClaim, 50); // default value before 6631166
1327 }
2596 FLAG_SET_CMDLINE(bool, ClassUnloading, false);
2597 // -Xincgc: i-CMS
2598 } else if (match_option(option, "-Xincgc", &tail)) {
2599 FLAG_SET_CMDLINE(bool, UseConcMarkSweepGC, true);
2600 FLAG_SET_CMDLINE(bool, CMSIncrementalMode, true);
2601 // -Xnoincgc: no i-CMS
2602 } else if (match_option(option, "-Xnoincgc", &tail)) {
2603 FLAG_SET_CMDLINE(bool, UseConcMarkSweepGC, false);
2604 FLAG_SET_CMDLINE(bool, CMSIncrementalMode, false);
2605 // -Xconcgc
2606 } else if (match_option(option, "-Xconcgc", &tail)) {
2607 FLAG_SET_CMDLINE(bool, UseConcMarkSweepGC, true);
2608 // -Xnoconcgc
2609 } else if (match_option(option, "-Xnoconcgc", &tail)) {
2610 FLAG_SET_CMDLINE(bool, UseConcMarkSweepGC, false);
2611 // -Xbatch
2612 } else if (match_option(option, "-Xbatch", &tail)) {
2613 FLAG_SET_CMDLINE(bool, BackgroundCompilation, false);
2614 // -Xmn for compatibility with other JVM vendors
2615 } else if (match_option(option, "-Xmn", &tail)) {
2616 julong long_initial_eden_size = 0;
2617 ArgsRange errcode = parse_memory_size(tail, &long_initial_eden_size, 1);
2618 if (errcode != arg_in_range) {
2619 jio_fprintf(defaultStream::error_stream(),
2620 "Invalid initial eden size: %s\n", option->optionString);
2621 describe_range_error(errcode);
2622 return JNI_EINVAL;
2623 }
2624 FLAG_SET_CMDLINE(uintx, MaxNewSize, (uintx)long_initial_eden_size);
2625 FLAG_SET_CMDLINE(uintx, NewSize, (uintx)long_initial_eden_size);
2626 // -Xms
2627 } else if (match_option(option, "-Xms", &tail)) {
2628 julong long_initial_heap_size = 0;
2629 // an initial heap size of 0 means automatically determine
2630 ArgsRange errcode = parse_memory_size(tail, &long_initial_heap_size, 0);
2631 if (errcode != arg_in_range) {
2632 jio_fprintf(defaultStream::error_stream(),
2633 "Invalid initial heap size: %s\n", option->optionString);
2634 describe_range_error(errcode);
2635 return JNI_EINVAL;
2636 }
2637 FLAG_SET_CMDLINE(uintx, InitialHeapSize, (uintx)long_initial_heap_size);
2638 // Currently the minimum size and the initial heap sizes are the same.
2639 set_min_heap_size(InitialHeapSize);
2640 // -Xmx
2641 } else if (match_option(option, "-Xmx", &tail) || match_option(option, "-XX:MaxHeapSize=", &tail)) {
2642 julong long_max_heap_size = 0;
2643 ArgsRange errcode = parse_memory_size(tail, &long_max_heap_size, 1);
2644 if (errcode != arg_in_range) {
2645 jio_fprintf(defaultStream::error_stream(),
|
1287 // promote all objects surviving "tenuring_default" scavenges.
1288 if (FLAG_IS_DEFAULT(MaxTenuringThreshold) &&
1289 FLAG_IS_DEFAULT(SurvivorRatio)) {
1290 FLAG_SET_ERGO(uintx, MaxTenuringThreshold, tenuring_default);
1291 }
1292 // If we decided above (or user explicitly requested)
1293 // `promote all' (via MaxTenuringThreshold := 0),
1294 // prefer minuscule survivor spaces so as not to waste
1295 // space for (non-existent) survivors
1296 if (FLAG_IS_DEFAULT(SurvivorRatio) && MaxTenuringThreshold == 0) {
1297 FLAG_SET_ERGO(uintx, SurvivorRatio, MAX2((uintx)1024, SurvivorRatio));
1298 }
1299 // If OldPLABSize is set and CMSParPromoteBlocksToClaim is not,
1300 // set CMSParPromoteBlocksToClaim equal to OldPLABSize.
1301 // This is done in order to make ParNew+CMS configuration to work
1302 // with YoungPLABSize and OldPLABSize options.
1303 // See CR 6362902.
1304 if (!FLAG_IS_DEFAULT(OldPLABSize)) {
1305 if (FLAG_IS_DEFAULT(CMSParPromoteBlocksToClaim)) {
1306 // OldPLABSize is not the default value but CMSParPromoteBlocksToClaim
1307 // is. In this situation let CMSParPromoteBlocksToClaim follow
1308 // the value (either from the command line or ergonomics) of
1309 // OldPLABSize. Following OldPLABSize is an ergonomics decision.
1310 FLAG_SET_ERGO(uintx, CMSParPromoteBlocksToClaim, OldPLABSize);
1311 } else {
1312 // OldPLABSize and CMSParPromoteBlocksToClaim are both set.
1313 // CMSParPromoteBlocksToClaim is a collector-specific flag, so
1314 // we'll let it to take precedence.
1315 jio_fprintf(defaultStream::error_stream(),
1316 "Both OldPLABSize and CMSParPromoteBlocksToClaim"
1317 " options are specified for the CMS collector."
1318 " CMSParPromoteBlocksToClaim will take precedence.\n");
1319 }
1320 }
1321 if (!FLAG_IS_DEFAULT(ResizeOldPLAB) && !ResizeOldPLAB) {
1322 // OldPLAB sizing manually turned off: Use a larger default setting,
1323 // unless it was manually specified. This is because a too-low value
1324 // will slow down scavenges.
1325 if (FLAG_IS_DEFAULT(CMSParPromoteBlocksToClaim)) {
1326 FLAG_SET_ERGO(uintx, CMSParPromoteBlocksToClaim, 50); // default value before 6631166
1327 }
2596 FLAG_SET_CMDLINE(bool, ClassUnloading, false);
2597 // -Xincgc: i-CMS
2598 } else if (match_option(option, "-Xincgc", &tail)) {
2599 FLAG_SET_CMDLINE(bool, UseConcMarkSweepGC, true);
2600 FLAG_SET_CMDLINE(bool, CMSIncrementalMode, true);
2601 // -Xnoincgc: no i-CMS
2602 } else if (match_option(option, "-Xnoincgc", &tail)) {
2603 FLAG_SET_CMDLINE(bool, UseConcMarkSweepGC, false);
2604 FLAG_SET_CMDLINE(bool, CMSIncrementalMode, false);
2605 // -Xconcgc
2606 } else if (match_option(option, "-Xconcgc", &tail)) {
2607 FLAG_SET_CMDLINE(bool, UseConcMarkSweepGC, true);
2608 // -Xnoconcgc
2609 } else if (match_option(option, "-Xnoconcgc", &tail)) {
2610 FLAG_SET_CMDLINE(bool, UseConcMarkSweepGC, false);
2611 // -Xbatch
2612 } else if (match_option(option, "-Xbatch", &tail)) {
2613 FLAG_SET_CMDLINE(bool, BackgroundCompilation, false);
2614 // -Xmn for compatibility with other JVM vendors
2615 } else if (match_option(option, "-Xmn", &tail)) {
2616 julong long_initial_young_size = 0;
2617 ArgsRange errcode = parse_memory_size(tail, &long_initial_young_size, 1);
2618 if (errcode != arg_in_range) {
2619 jio_fprintf(defaultStream::error_stream(),
2620 "Invalid initial young generation size: %s\n", option->optionString);
2621 describe_range_error(errcode);
2622 return JNI_EINVAL;
2623 }
2624 FLAG_SET_CMDLINE(uintx, MaxNewSize, (uintx)long_initial_young_size);
2625 FLAG_SET_CMDLINE(uintx, NewSize, (uintx)long_initial_young_size);
2626 // -Xms
2627 } else if (match_option(option, "-Xms", &tail)) {
2628 julong long_initial_heap_size = 0;
2629 // an initial heap size of 0 means automatically determine
2630 ArgsRange errcode = parse_memory_size(tail, &long_initial_heap_size, 0);
2631 if (errcode != arg_in_range) {
2632 jio_fprintf(defaultStream::error_stream(),
2633 "Invalid initial heap size: %s\n", option->optionString);
2634 describe_range_error(errcode);
2635 return JNI_EINVAL;
2636 }
2637 FLAG_SET_CMDLINE(uintx, InitialHeapSize, (uintx)long_initial_heap_size);
2638 // Currently the minimum size and the initial heap sizes are the same.
2639 set_min_heap_size(InitialHeapSize);
2640 // -Xmx
2641 } else if (match_option(option, "-Xmx", &tail) || match_option(option, "-XX:MaxHeapSize=", &tail)) {
2642 julong long_max_heap_size = 0;
2643 ArgsRange errcode = parse_memory_size(tail, &long_max_heap_size, 1);
2644 if (errcode != arg_in_range) {
2645 jio_fprintf(defaultStream::error_stream(),
|