src/share/vm/runtime/arguments.cpp
Print this page
@@ -1132,15 +1132,10 @@
}
if (FLAG_IS_DEFAULT(OldPLABSize)) {
FLAG_SET_DEFAULT(OldPLABSize, (intx)1024);
}
- // AlwaysTenure flag should make ParNew promote all at first collection.
- // See CR 6362902.
- if (AlwaysTenure) {
- FLAG_SET_CMDLINE(uintx, MaxTenuringThreshold, 0);
- }
// When using compressed oops, we use local overflow stacks,
// rather than using a global overflow list chained through
// the klass word of the object's pre-image.
if (UseCompressedOops && !ParGCUseLocalOverflow) {
if (!FLAG_IS_DEFAULT(ParGCUseLocalOverflow)) {
@@ -2172,14 +2167,12 @@
status = status && verify_min_value(TLABRefillWasteFraction, 1, "TLABRefillWasteFraction");
status = status && verify_percentage(YoungGenerationSizeSupplement, "YoungGenerationSizeSupplement");
status = status && verify_percentage(TenuredGenerationSizeSupplement, "TenuredGenerationSizeSupplement");
- // the "age" field in the oop header is 4 bits; do not want to pull in markOop.hpp
- // just for that, so hardcode here.
- status = status && verify_interval(MaxTenuringThreshold, 0, 15, "MaxTenuringThreshold");
- status = status && verify_interval(InitialTenuringThreshold, 0, MaxTenuringThreshold, "MaxTenuringThreshold");
+ status = status && verify_interval(MaxTenuringThreshold, 0, markOopDesc::max_age + 1, "MaxTenuringThreshold");
+ status = status && verify_interval(InitialTenuringThreshold, 0, MaxTenuringThreshold, "InitialTenuringThreshold");
status = status && verify_percentage(TargetSurvivorRatio, "TargetSurvivorRatio");
status = status && verify_percentage(MarkSweepDeadRatio, "MarkSweepDeadRatio");
status = status && verify_min_value(MarkSweepAlwaysCompactCount, 1, "MarkSweepAlwaysCompactCount");
#ifdef SPARC
@@ -2883,18 +2876,38 @@
// Get around early Solaris scheduling bug
// (affinity vs other jobs on system)
// but disallow DR and offlining (5008695).
FLAG_SET_CMDLINE(bool, BindGCTaskThreadsToCPUs, true);
+ // Need to keep consistency of MaxTenuringThreshold and AlwaysTenure/NeverTenure;
+ // the last option wins.
} else if (match_option(option, "-XX:+NeverTenure", &tail)) {
- // The last option must always win.
- FLAG_SET_CMDLINE(bool, AlwaysTenure, false);
FLAG_SET_CMDLINE(bool, NeverTenure, true);
+ FLAG_SET_CMDLINE(bool, AlwaysTenure, false);
+ FLAG_SET_CMDLINE(uintx, MaxTenuringThreshold, markOopDesc::max_age + 1);
} else if (match_option(option, "-XX:+AlwaysTenure", &tail)) {
- // The last option must always win.
FLAG_SET_CMDLINE(bool, NeverTenure, false);
FLAG_SET_CMDLINE(bool, AlwaysTenure, true);
+ FLAG_SET_CMDLINE(uintx, MaxTenuringThreshold, 0);
+ } else if (match_option(option, "-XX:MaxTenuringThreshold=", &tail)) {
+ uintx max_tenuring_thresh = 0;
+ if(!parse_uintx(tail, &max_tenuring_thresh, 0)) {
+ jio_fprintf(defaultStream::error_stream(),
+ "Invalid MaxTenuringThreshold: %s\n", option->optionString);
+ }
+ FLAG_SET_CMDLINE(uintx, MaxTenuringThreshold, max_tenuring_thresh);
+
+ if (MaxTenuringThreshold == 0) {
+ FLAG_SET_CMDLINE(bool, NeverTenure, false);
+ FLAG_SET_CMDLINE(bool, AlwaysTenure, true);
+ } else {
+ FLAG_SET_CMDLINE(bool, NeverTenure, false);
+ FLAG_SET_CMDLINE(bool, AlwaysTenure, false);
+ if (MaxTenuringThreshold > markOopDesc::max_age + 1) {
+ FLAG_SET_CMDLINE(uintx, MaxTenuringThreshold, markOopDesc::max_age + 1);
+ }
+ }
} else if (match_option(option, "-XX:+CMSPermGenSweepingEnabled", &tail) ||
match_option(option, "-XX:-CMSPermGenSweepingEnabled", &tail)) {
jio_fprintf(defaultStream::error_stream(),
"Please use CMSClassUnloadingEnabled in place of "
"CMSPermGenSweepingEnabled in the future\n");