src/share/vm/runtime/arguments.cpp

Print this page




1159   if (FLAG_IS_DEFAULT(ParallelGCThreads)) {
1160     FLAG_SET_DEFAULT(ParallelGCThreads, Abstract_VM_Version::parallel_worker_threads());
1161     assert(ParallelGCThreads > 0, "We should always have at least one thread by default");
1162   } else if (ParallelGCThreads == 0) {
1163     jio_fprintf(defaultStream::error_stream(),
1164         "The ParNew GC can not be combined with -XX:ParallelGCThreads=0\n");
1165     vm_exit(1);
1166   }
1167 
1168   // By default YoungPLABSize and OldPLABSize are set to 4096 and 1024 respectively,
1169   // these settings are default for Parallel Scavenger. For ParNew+Tenured configuration
1170   // we set them to 1024 and 1024.
1171   // See CR 6362902.
1172   if (FLAG_IS_DEFAULT(YoungPLABSize)) {
1173     FLAG_SET_DEFAULT(YoungPLABSize, (intx)1024);
1174   }
1175   if (FLAG_IS_DEFAULT(OldPLABSize)) {
1176     FLAG_SET_DEFAULT(OldPLABSize, (intx)1024);
1177   }
1178 
1179   // AlwaysTenure flag should make ParNew promote all at first collection.
1180   // See CR 6362902.
1181   if (AlwaysTenure) {
1182     FLAG_SET_CMDLINE(uintx, MaxTenuringThreshold, 0);
1183   }
1184   // When using compressed oops, we use local overflow stacks,
1185   // rather than using a global overflow list chained through
1186   // the klass word of the object's pre-image.
1187   if (UseCompressedOops && !ParGCUseLocalOverflow) {
1188     if (!FLAG_IS_DEFAULT(ParGCUseLocalOverflow)) {
1189       warning("Forcing +ParGCUseLocalOverflow: needed if using compressed references");
1190     }
1191     FLAG_SET_DEFAULT(ParGCUseLocalOverflow, true);
1192   }
1193   assert(ParGCUseLocalOverflow || !UseCompressedOops, "Error");
1194 }
1195 
1196 // Adjust some sizes to suit CMS and/or ParNew needs; these work well on
1197 // sparc/solaris for certain applications, but would gain from
1198 // further optimization and tuning efforts, and would almost
1199 // certainly gain from analysis of platform and environment.
1200 void Arguments::set_cms_and_parnew_gc_flags() {
1201   assert(!UseSerialGC && !UseParallelOldGC && !UseParallelGC, "Error");
1202   assert(UseConcMarkSweepGC, "CMS is expected to be on here");
1203 


2256   status = status && verify_percentage(ParallelGCBufferWastePct, "ParallelGCBufferWastePct");
2257   status = status && verify_interval(TargetPLABWastePct, 1, 100, "TargetPLABWastePct");
2258 
2259   status = status && verify_min_value(ParGCStridesPerThread, 1, "ParGCStridesPerThread");
2260 
2261   status = status && verify_min_value(MinRAMFraction, 1, "MinRAMFraction");
2262   status = status && verify_min_value(InitialRAMFraction, 1, "InitialRAMFraction");
2263   status = status && verify_min_value(MaxRAMFraction, 1, "MaxRAMFraction");
2264   status = status && verify_min_value(DefaultMaxRAMFraction, 1, "DefaultMaxRAMFraction");
2265 
2266   status = status && verify_interval(AdaptiveTimeWeight, 0, 100, "AdaptiveTimeWeight");
2267   status = status && verify_min_value(AdaptiveSizeDecrementScaleFactor, 1, "AdaptiveSizeDecrementScaleFactor");
2268 
2269   status = status && verify_interval(TLABAllocationWeight, 0, 100, "TLABAllocationWeight");
2270   status = status && verify_min_value(MinTLABSize, 1, "MinTLABSize");
2271   status = status && verify_min_value(TLABRefillWasteFraction, 1, "TLABRefillWasteFraction");
2272 
2273   status = status && verify_percentage(YoungGenerationSizeSupplement, "YoungGenerationSizeSupplement");
2274   status = status && verify_percentage(TenuredGenerationSizeSupplement, "TenuredGenerationSizeSupplement");
2275 
2276   // the "age" field in the oop header is 4 bits; do not want to pull in markOop.hpp
2277   // just for that, so hardcode here.
2278   status = status && verify_interval(MaxTenuringThreshold, 0, 15, "MaxTenuringThreshold");
2279   status = status && verify_interval(InitialTenuringThreshold, 0, MaxTenuringThreshold, "MaxTenuringThreshold");
2280   status = status && verify_percentage(TargetSurvivorRatio, "TargetSurvivorRatio");
2281   status = status && verify_percentage(MarkSweepDeadRatio, "MarkSweepDeadRatio");
2282 
2283   status = status && verify_min_value(MarkSweepAlwaysCompactCount, 1, "MarkSweepAlwaysCompactCount");
2284 #ifdef SPARC
2285   if (UseConcMarkSweepGC || UseG1GC) {
2286     // Issue a stern warning if the user has explicitly set
2287     // UseMemSetInBOT (it is known to cause issues), but allow
2288     // use for experimentation and debugging.
2289     if (VM_Version::is_sun4v() && UseMemSetInBOT) {
2290       assert(!FLAG_IS_DEFAULT(UseMemSetInBOT), "Error");
2291       warning("Experimental flag -XX:+UseMemSetInBOT is known to cause instability"
2292           " on sun4v; please understand that you are using at your own risk!");
2293     }
2294   }
2295 #endif // SPARC
2296 
2297   if (PrintNMTStatistics) {
2298 #if INCLUDE_NMT
2299     if (MemTracker::tracking_level() == MemTracker::NMT_off) {


2991       // number of PLAB allocation events during gc.  The value of 8kw
2992       // was arrived at by experimenting with specjbb.
2993       FLAG_SET_CMDLINE(uintx, OldPLABSize, 8*K);  // Note: this is in words
2994 
2995       // Enable parallel GC and adaptive generation sizing
2996       FLAG_SET_CMDLINE(bool, UseParallelGC, true);
2997       FLAG_SET_DEFAULT(ParallelGCThreads,
2998                        Abstract_VM_Version::parallel_worker_threads());
2999 
3000       // Encourage steady state memory management
3001       FLAG_SET_CMDLINE(uintx, ThresholdTolerance, 100);
3002 
3003       // This appears to improve mutator locality
3004       FLAG_SET_CMDLINE(bool, ScavengeBeforeFullGC, false);
3005 
3006       // Get around early Solaris scheduling bug
3007       // (affinity vs other jobs on system)
3008       // but disallow DR and offlining (5008695).
3009       FLAG_SET_CMDLINE(bool, BindGCTaskThreadsToCPUs, true);
3010 


3011     } else if (match_option(option, "-XX:+NeverTenure", &tail)) {
3012       // The last option must always win.
3013       FLAG_SET_CMDLINE(bool, AlwaysTenure, false);
3014       FLAG_SET_CMDLINE(bool, NeverTenure, true);


3015     } else if (match_option(option, "-XX:+AlwaysTenure", &tail)) {
3016       // The last option must always win.
3017       FLAG_SET_CMDLINE(bool, NeverTenure, false);
3018       FLAG_SET_CMDLINE(bool, AlwaysTenure, true);
















3019     } else if (match_option(option, "-XX:+CMSPermGenSweepingEnabled", &tail) ||
3020                match_option(option, "-XX:-CMSPermGenSweepingEnabled", &tail)) {
3021       jio_fprintf(defaultStream::error_stream(),
3022         "Please use CMSClassUnloadingEnabled in place of "
3023         "CMSPermGenSweepingEnabled in the future\n");
3024     } else if (match_option(option, "-XX:+UseGCTimeLimit", &tail)) {
3025       FLAG_SET_CMDLINE(bool, UseGCOverheadLimit, true);
3026       jio_fprintf(defaultStream::error_stream(),
3027         "Please use -XX:+UseGCOverheadLimit in place of "
3028         "-XX:+UseGCTimeLimit in the future\n");
3029     } else if (match_option(option, "-XX:-UseGCTimeLimit", &tail)) {
3030       FLAG_SET_CMDLINE(bool, UseGCOverheadLimit, false);
3031       jio_fprintf(defaultStream::error_stream(),
3032         "Please use -XX:-UseGCOverheadLimit in place of "
3033         "-XX:-UseGCTimeLimit in the future\n");
3034     // The TLE options are for compatibility with 1.3 and will be
3035     // removed without notice in a future release.  These options
3036     // are not to be documented.
3037     } else if (match_option(option, "-XX:MaxTLERatio=", &tail)) {
3038       // No longer used.




1159   if (FLAG_IS_DEFAULT(ParallelGCThreads)) {
1160     FLAG_SET_DEFAULT(ParallelGCThreads, Abstract_VM_Version::parallel_worker_threads());
1161     assert(ParallelGCThreads > 0, "We should always have at least one thread by default");
1162   } else if (ParallelGCThreads == 0) {
1163     jio_fprintf(defaultStream::error_stream(),
1164         "The ParNew GC can not be combined with -XX:ParallelGCThreads=0\n");
1165     vm_exit(1);
1166   }
1167 
1168   // By default YoungPLABSize and OldPLABSize are set to 4096 and 1024 respectively,
1169   // these settings are default for Parallel Scavenger. For ParNew+Tenured configuration
1170   // we set them to 1024 and 1024.
1171   // See CR 6362902.
1172   if (FLAG_IS_DEFAULT(YoungPLABSize)) {
1173     FLAG_SET_DEFAULT(YoungPLABSize, (intx)1024);
1174   }
1175   if (FLAG_IS_DEFAULT(OldPLABSize)) {
1176     FLAG_SET_DEFAULT(OldPLABSize, (intx)1024);
1177   }
1178 





1179   // When using compressed oops, we use local overflow stacks,
1180   // rather than using a global overflow list chained through
1181   // the klass word of the object's pre-image.
1182   if (UseCompressedOops && !ParGCUseLocalOverflow) {
1183     if (!FLAG_IS_DEFAULT(ParGCUseLocalOverflow)) {
1184       warning("Forcing +ParGCUseLocalOverflow: needed if using compressed references");
1185     }
1186     FLAG_SET_DEFAULT(ParGCUseLocalOverflow, true);
1187   }
1188   assert(ParGCUseLocalOverflow || !UseCompressedOops, "Error");
1189 }
1190 
1191 // Adjust some sizes to suit CMS and/or ParNew needs; these work well on
1192 // sparc/solaris for certain applications, but would gain from
1193 // further optimization and tuning efforts, and would almost
1194 // certainly gain from analysis of platform and environment.
1195 void Arguments::set_cms_and_parnew_gc_flags() {
1196   assert(!UseSerialGC && !UseParallelOldGC && !UseParallelGC, "Error");
1197   assert(UseConcMarkSweepGC, "CMS is expected to be on here");
1198 


2251   status = status && verify_percentage(ParallelGCBufferWastePct, "ParallelGCBufferWastePct");
2252   status = status && verify_interval(TargetPLABWastePct, 1, 100, "TargetPLABWastePct");
2253 
2254   status = status && verify_min_value(ParGCStridesPerThread, 1, "ParGCStridesPerThread");
2255 
2256   status = status && verify_min_value(MinRAMFraction, 1, "MinRAMFraction");
2257   status = status && verify_min_value(InitialRAMFraction, 1, "InitialRAMFraction");
2258   status = status && verify_min_value(MaxRAMFraction, 1, "MaxRAMFraction");
2259   status = status && verify_min_value(DefaultMaxRAMFraction, 1, "DefaultMaxRAMFraction");
2260 
2261   status = status && verify_interval(AdaptiveTimeWeight, 0, 100, "AdaptiveTimeWeight");
2262   status = status && verify_min_value(AdaptiveSizeDecrementScaleFactor, 1, "AdaptiveSizeDecrementScaleFactor");
2263 
2264   status = status && verify_interval(TLABAllocationWeight, 0, 100, "TLABAllocationWeight");
2265   status = status && verify_min_value(MinTLABSize, 1, "MinTLABSize");
2266   status = status && verify_min_value(TLABRefillWasteFraction, 1, "TLABRefillWasteFraction");
2267 
2268   status = status && verify_percentage(YoungGenerationSizeSupplement, "YoungGenerationSizeSupplement");
2269   status = status && verify_percentage(TenuredGenerationSizeSupplement, "TenuredGenerationSizeSupplement");
2270 
2271   status = status && verify_interval(MaxTenuringThreshold, 0, markOopDesc::max_age + 1, "MaxTenuringThreshold");
2272   status = status && verify_interval(InitialTenuringThreshold, 0, MaxTenuringThreshold, "InitialTenuringThreshold");


2273   status = status && verify_percentage(TargetSurvivorRatio, "TargetSurvivorRatio");
2274   status = status && verify_percentage(MarkSweepDeadRatio, "MarkSweepDeadRatio");
2275 
2276   status = status && verify_min_value(MarkSweepAlwaysCompactCount, 1, "MarkSweepAlwaysCompactCount");
2277 #ifdef SPARC
2278   if (UseConcMarkSweepGC || UseG1GC) {
2279     // Issue a stern warning if the user has explicitly set
2280     // UseMemSetInBOT (it is known to cause issues), but allow
2281     // use for experimentation and debugging.
2282     if (VM_Version::is_sun4v() && UseMemSetInBOT) {
2283       assert(!FLAG_IS_DEFAULT(UseMemSetInBOT), "Error");
2284       warning("Experimental flag -XX:+UseMemSetInBOT is known to cause instability"
2285           " on sun4v; please understand that you are using at your own risk!");
2286     }
2287   }
2288 #endif // SPARC
2289 
2290   if (PrintNMTStatistics) {
2291 #if INCLUDE_NMT
2292     if (MemTracker::tracking_level() == MemTracker::NMT_off) {


2984       // number of PLAB allocation events during gc.  The value of 8kw
2985       // was arrived at by experimenting with specjbb.
2986       FLAG_SET_CMDLINE(uintx, OldPLABSize, 8*K);  // Note: this is in words
2987 
2988       // Enable parallel GC and adaptive generation sizing
2989       FLAG_SET_CMDLINE(bool, UseParallelGC, true);
2990       FLAG_SET_DEFAULT(ParallelGCThreads,
2991                        Abstract_VM_Version::parallel_worker_threads());
2992 
2993       // Encourage steady state memory management
2994       FLAG_SET_CMDLINE(uintx, ThresholdTolerance, 100);
2995 
2996       // This appears to improve mutator locality
2997       FLAG_SET_CMDLINE(bool, ScavengeBeforeFullGC, false);
2998 
2999       // Get around early Solaris scheduling bug
3000       // (affinity vs other jobs on system)
3001       // but disallow DR and offlining (5008695).
3002       FLAG_SET_CMDLINE(bool, BindGCTaskThreadsToCPUs, true);
3003 
3004     // Need to keep consistency of MaxTenuringThreshold and AlwaysTenure/NeverTenure;
3005     // and the last option wins.
3006     } else if (match_option(option, "-XX:+NeverTenure", &tail)) {


3007       FLAG_SET_CMDLINE(bool, NeverTenure, true);
3008       FLAG_SET_CMDLINE(bool, AlwaysTenure, false);
3009       FLAG_SET_CMDLINE(uintx, MaxTenuringThreshold, markOopDesc::max_age + 1);
3010     } else if (match_option(option, "-XX:+AlwaysTenure", &tail)) {

3011       FLAG_SET_CMDLINE(bool, NeverTenure, false);
3012       FLAG_SET_CMDLINE(bool, AlwaysTenure, true);
3013       FLAG_SET_CMDLINE(uintx, MaxTenuringThreshold, 0);
3014     } else if (match_option(option, "-XX:MaxTenuringThreshold=", &tail)) {
3015       uintx max_tenuring_thresh = 0;
3016       if(!parse_uintx(tail, &max_tenuring_thresh, 0)) {
3017         jio_fprintf(defaultStream::error_stream(),
3018                     "Invalid MaxTenuringThreshold: %s\n", option->optionString);
3019       }
3020       FLAG_SET_CMDLINE(uintx, MaxTenuringThreshold, max_tenuring_thresh);
3021 
3022       if (MaxTenuringThreshold == 0) {
3023         FLAG_SET_CMDLINE(bool, NeverTenure, false);
3024         FLAG_SET_CMDLINE(bool, AlwaysTenure, true);
3025       } else {
3026         FLAG_SET_CMDLINE(bool, NeverTenure, false);
3027         FLAG_SET_CMDLINE(bool, AlwaysTenure, false);
3028       }
3029     } else if (match_option(option, "-XX:+CMSPermGenSweepingEnabled", &tail) ||
3030                match_option(option, "-XX:-CMSPermGenSweepingEnabled", &tail)) {
3031       jio_fprintf(defaultStream::error_stream(),
3032         "Please use CMSClassUnloadingEnabled in place of "
3033         "CMSPermGenSweepingEnabled in the future\n");
3034     } else if (match_option(option, "-XX:+UseGCTimeLimit", &tail)) {
3035       FLAG_SET_CMDLINE(bool, UseGCOverheadLimit, true);
3036       jio_fprintf(defaultStream::error_stream(),
3037         "Please use -XX:+UseGCOverheadLimit in place of "
3038         "-XX:+UseGCTimeLimit in the future\n");
3039     } else if (match_option(option, "-XX:-UseGCTimeLimit", &tail)) {
3040       FLAG_SET_CMDLINE(bool, UseGCOverheadLimit, false);
3041       jio_fprintf(defaultStream::error_stream(),
3042         "Please use -XX:-UseGCOverheadLimit in place of "
3043         "-XX:-UseGCTimeLimit in the future\n");
3044     // The TLE options are for compatibility with 1.3 and will be
3045     // removed without notice in a future release.  These options
3046     // are not to be documented.
3047     } else if (match_option(option, "-XX:MaxTLERatio=", &tail)) {
3048       // No longer used.