Mercurial > hg > truffle
comparison src/share/vm/runtime/arguments.cpp @ 10:28372612af5e
6362677: Change parallel GC collector default number of parallel GC threads.
Summary: Use the same default number of GC threads as used by ParNewGC and ConcMarkSweepGC (i.e., the 5/8th rule).
Reviewed-by: ysr, tonyp
author | jmasa |
---|---|
date | Fri, 22 Feb 2008 17:17:14 -0800 |
parents | a61af66fc99e |
children | 183f41cf8bfe |
comparison
equal
deleted
inserted
replaced
9:173195ff483a | 10:28372612af5e |
---|---|
922 // UseParNewGC and not explicitly set ParallelGCThreads we | 922 // UseParNewGC and not explicitly set ParallelGCThreads we |
923 // set it, unless this is a single cpu machine. | 923 // set it, unless this is a single cpu machine. |
924 void Arguments::set_parnew_gc_flags() { | 924 void Arguments::set_parnew_gc_flags() { |
925 assert(!UseSerialGC && !UseParallelGC, "control point invariant"); | 925 assert(!UseSerialGC && !UseParallelGC, "control point invariant"); |
926 | 926 |
927 // Turn off AdaptiveSizePolicy by default for parnew until it is | |
928 // complete. | |
929 if (UseParNewGC && | |
930 FLAG_IS_DEFAULT(UseAdaptiveSizePolicy)) { | |
931 FLAG_SET_DEFAULT(UseAdaptiveSizePolicy, false); | |
932 } | |
933 | |
927 if (FLAG_IS_DEFAULT(UseParNewGC) && ParallelGCThreads > 1) { | 934 if (FLAG_IS_DEFAULT(UseParNewGC) && ParallelGCThreads > 1) { |
928 FLAG_SET_DEFAULT(UseParNewGC, true); | 935 FLAG_SET_DEFAULT(UseParNewGC, true); |
929 } else if (UseParNewGC && ParallelGCThreads == 0) { | 936 } else if (UseParNewGC && ParallelGCThreads == 0) { |
930 FLAG_SET_DEFAULT(ParallelGCThreads, nof_parallel_gc_threads()); | 937 FLAG_SET_DEFAULT(ParallelGCThreads, |
938 Abstract_VM_Version::parallel_worker_threads()); | |
931 if (FLAG_IS_DEFAULT(ParallelGCThreads) && ParallelGCThreads == 1) { | 939 if (FLAG_IS_DEFAULT(ParallelGCThreads) && ParallelGCThreads == 1) { |
932 FLAG_SET_DEFAULT(UseParNewGC, false); | 940 FLAG_SET_DEFAULT(UseParNewGC, false); |
933 } | 941 } |
934 } | 942 } |
935 if (!UseParNewGC) { | 943 if (!UseParNewGC) { |
951 // AlwaysTenure flag should make ParNew to promote all at first collection. | 959 // AlwaysTenure flag should make ParNew to promote all at first collection. |
952 // See CR 6362902. | 960 // See CR 6362902. |
953 if (AlwaysTenure) { | 961 if (AlwaysTenure) { |
954 FLAG_SET_CMDLINE(intx, MaxTenuringThreshold, 0); | 962 FLAG_SET_CMDLINE(intx, MaxTenuringThreshold, 0); |
955 } | 963 } |
956 } | |
957 } | |
958 | |
959 // CAUTION: this code is currently shared by UseParallelGC, UseParNewGC and | |
960 // UseconcMarkSweepGC. Further tuning of individual collectors might | |
961 // dictate refinement on a per-collector basis. | |
962 int Arguments::nof_parallel_gc_threads() { | |
963 if (FLAG_IS_DEFAULT(ParallelGCThreads)) { | |
964 // For very large machines, there are diminishing returns | |
965 // for large numbers of worker threads. Instead of | |
966 // hogging the whole system, use 5/8ths of a worker for every | |
967 // processor after the first 8. For example, on a 72 cpu | |
968 // machine use 8 + (72 - 8) * (5/8) == 48 worker threads. | |
969 // This is just a start and needs further tuning and study in | |
970 // Tiger. | |
971 int ncpus = os::active_processor_count(); | |
972 return (ncpus <= 8) ? ncpus : 3 + ((ncpus * 5) / 8); | |
973 } else { | |
974 return ParallelGCThreads; | |
975 } | 964 } |
976 } | 965 } |
977 | 966 |
978 // Adjust some sizes to suit CMS and/or ParNew needs; these work well on | 967 // Adjust some sizes to suit CMS and/or ParNew needs; these work well on |
979 // sparc/solaris for certain applications, but would gain from | 968 // sparc/solaris for certain applications, but would gain from |
982 void Arguments::set_cms_and_parnew_gc_flags() { | 971 void Arguments::set_cms_and_parnew_gc_flags() { |
983 if (UseSerialGC || UseParallelGC) { | 972 if (UseSerialGC || UseParallelGC) { |
984 return; | 973 return; |
985 } | 974 } |
986 | 975 |
976 assert(UseConcMarkSweepGC, "CMS is expected to be on here"); | |
977 | |
987 // If we are using CMS, we prefer to UseParNewGC, | 978 // If we are using CMS, we prefer to UseParNewGC, |
988 // unless explicitly forbidden. | 979 // unless explicitly forbidden. |
989 if (UseConcMarkSweepGC && !UseParNewGC && FLAG_IS_DEFAULT(UseParNewGC)) { | 980 if (!UseParNewGC && FLAG_IS_DEFAULT(UseParNewGC)) { |
990 FLAG_SET_DEFAULT(UseParNewGC, true); | 981 FLAG_SET_ERGO(bool, UseParNewGC, true); |
991 } | 982 } |
992 | 983 |
993 // Turn off AdaptiveSizePolicy by default for cms until it is | 984 // Turn off AdaptiveSizePolicy by default for cms until it is |
994 // complete. Also turn it off in general if the | 985 // complete. |
995 // parnew collector has been selected. | 986 if (FLAG_IS_DEFAULT(UseAdaptiveSizePolicy)) { |
996 if ((UseConcMarkSweepGC || UseParNewGC) && | |
997 FLAG_IS_DEFAULT(UseAdaptiveSizePolicy)) { | |
998 FLAG_SET_DEFAULT(UseAdaptiveSizePolicy, false); | 987 FLAG_SET_DEFAULT(UseAdaptiveSizePolicy, false); |
999 } | 988 } |
1000 | 989 |
1001 // In either case, adjust ParallelGCThreads and/or UseParNewGC | 990 // In either case, adjust ParallelGCThreads and/or UseParNewGC |
1002 // as needed. | 991 // as needed. |
1003 set_parnew_gc_flags(); | 992 if (UseParNewGC) { |
1004 | 993 set_parnew_gc_flags(); |
1005 if (!UseConcMarkSweepGC) { | |
1006 return; | |
1007 } | 994 } |
1008 | 995 |
1009 // Now make adjustments for CMS | 996 // Now make adjustments for CMS |
1010 size_t young_gen_per_worker; | 997 size_t young_gen_per_worker; |
1011 intx new_ratio; | 998 intx new_ratio; |
1145 !UseParNewGC && | 1132 !UseParNewGC && |
1146 !DumpSharedSpaces && | 1133 !DumpSharedSpaces && |
1147 FLAG_IS_DEFAULT(UseParallelGC)) { | 1134 FLAG_IS_DEFAULT(UseParallelGC)) { |
1148 if (should_auto_select_low_pause_collector()) { | 1135 if (should_auto_select_low_pause_collector()) { |
1149 FLAG_SET_ERGO(bool, UseConcMarkSweepGC, true); | 1136 FLAG_SET_ERGO(bool, UseConcMarkSweepGC, true); |
1150 set_cms_and_parnew_gc_flags(); | |
1151 } else { | 1137 } else { |
1152 FLAG_SET_ERGO(bool, UseParallelGC, true); | 1138 FLAG_SET_ERGO(bool, UseParallelGC, true); |
1153 } | 1139 } |
1154 no_shared_spaces(); | 1140 no_shared_spaces(); |
1155 } | 1141 } |
1156 | |
1157 // This is here because the parallel collector could | |
1158 // have been selected so this initialization should | |
1159 // still be done. | |
1160 set_parallel_gc_flags(); | |
1161 } | 1142 } |
1162 } | 1143 } |
1163 | 1144 |
1164 void Arguments::set_parallel_gc_flags() { | 1145 void Arguments::set_parallel_gc_flags() { |
1165 // If parallel old was requested, automatically enable parallel scavenge. | 1146 // If parallel old was requested, automatically enable parallel scavenge. |
1168 } | 1149 } |
1169 | 1150 |
1170 // If no heap maximum was requested explicitly, use some reasonable fraction | 1151 // If no heap maximum was requested explicitly, use some reasonable fraction |
1171 // of the physical memory, up to a maximum of 1GB. | 1152 // of the physical memory, up to a maximum of 1GB. |
1172 if (UseParallelGC) { | 1153 if (UseParallelGC) { |
1154 FLAG_SET_ERGO(uintx, ParallelGCThreads, | |
1155 Abstract_VM_Version::parallel_worker_threads()); | |
1156 | |
1173 if (FLAG_IS_DEFAULT(MaxHeapSize)) { | 1157 if (FLAG_IS_DEFAULT(MaxHeapSize)) { |
1174 const uint64_t reasonable_fraction = | 1158 const uint64_t reasonable_fraction = |
1175 os::physical_memory() / DefaultMaxRAMFraction; | 1159 os::physical_memory() / DefaultMaxRAMFraction; |
1176 const uint64_t maximum_size = (uint64_t) DefaultMaxRAM; | 1160 const uint64_t maximum_size = (uint64_t) DefaultMaxRAM; |
1177 size_t reasonable_max = | 1161 size_t reasonable_max = |
1310 return (UseSerialGC && | 1294 return (UseSerialGC && |
1311 !(UseParNewGC || UseConcMarkSweepGC || UseParallelGC || | 1295 !(UseParNewGC || UseConcMarkSweepGC || UseParallelGC || |
1312 UseParallelOldGC)); | 1296 UseParallelOldGC)); |
1313 } | 1297 } |
1314 | 1298 |
1315 // Check the consistency of vm_init_args | 1299 // Check consistency of GC selection |
1316 bool Arguments::check_vm_args_consistency() { | 1300 bool Arguments::check_gc_consistency() { |
1317 // Method for adding checks for flag consistency. | |
1318 // The intent is to warn the user of all possible conflicts, | |
1319 // before returning an error. | |
1320 // Note: Needs platform-dependent factoring. | |
1321 bool status = true; | 1301 bool status = true; |
1322 | |
1323 #if ( (defined(COMPILER2) && defined(SPARC))) | |
1324 // NOTE: The call to VM_Version_init depends on the fact that VM_Version_init | |
1325 // on sparc doesn't require generation of a stub as is the case on, e.g., | |
1326 // x86. Normally, VM_Version_init must be called from init_globals in | |
1327 // init.cpp, which is called by the initial java thread *after* arguments | |
1328 // have been parsed. VM_Version_init gets called twice on sparc. | |
1329 extern void VM_Version_init(); | |
1330 VM_Version_init(); | |
1331 if (!VM_Version::has_v9()) { | |
1332 jio_fprintf(defaultStream::error_stream(), | |
1333 "V8 Machine detected, Server requires V9\n"); | |
1334 status = false; | |
1335 } | |
1336 #endif /* COMPILER2 && SPARC */ | |
1337 | |
1338 // Allow both -XX:-UseStackBanging and -XX:-UseBoundThreads in non-product | |
1339 // builds so the cost of stack banging can be measured. | |
1340 #if (defined(PRODUCT) && defined(SOLARIS)) | |
1341 if (!UseBoundThreads && !UseStackBanging) { | |
1342 jio_fprintf(defaultStream::error_stream(), | |
1343 "-UseStackBanging conflicts with -UseBoundThreads\n"); | |
1344 | |
1345 status = false; | |
1346 } | |
1347 #endif | |
1348 | |
1349 if (TLABRefillWasteFraction == 0) { | |
1350 jio_fprintf(defaultStream::error_stream(), | |
1351 "TLABRefillWasteFraction should be a denominator, " | |
1352 "not " SIZE_FORMAT "\n", | |
1353 TLABRefillWasteFraction); | |
1354 status = false; | |
1355 } | |
1356 | |
1357 status &= verify_percentage(MaxLiveObjectEvacuationRatio, | |
1358 "MaxLiveObjectEvacuationRatio"); | |
1359 status &= verify_percentage(AdaptiveSizePolicyWeight, | |
1360 "AdaptiveSizePolicyWeight"); | |
1361 status &= verify_percentage(AdaptivePermSizeWeight, "AdaptivePermSizeWeight"); | |
1362 status &= verify_percentage(ThresholdTolerance, "ThresholdTolerance"); | |
1363 status &= verify_percentage(MinHeapFreeRatio, "MinHeapFreeRatio"); | |
1364 status &= verify_percentage(MaxHeapFreeRatio, "MaxHeapFreeRatio"); | |
1365 | |
1366 if (MinHeapFreeRatio > MaxHeapFreeRatio) { | |
1367 jio_fprintf(defaultStream::error_stream(), | |
1368 "MinHeapFreeRatio (" UINTX_FORMAT ") must be less than or " | |
1369 "equal to MaxHeapFreeRatio (" UINTX_FORMAT ")\n", | |
1370 MinHeapFreeRatio, MaxHeapFreeRatio); | |
1371 status = false; | |
1372 } | |
1373 // Keeping the heap 100% free is hard ;-) so limit it to 99%. | |
1374 MinHeapFreeRatio = MIN2(MinHeapFreeRatio, (uintx) 99); | |
1375 | |
1376 if (FullGCALot && FLAG_IS_DEFAULT(MarkSweepAlwaysCompactCount)) { | |
1377 MarkSweepAlwaysCompactCount = 1; // Move objects every gc. | |
1378 } | |
1379 | |
1380 status &= verify_percentage(GCHeapFreeLimit, "GCHeapFreeLimit"); | |
1381 status &= verify_percentage(GCTimeLimit, "GCTimeLimit"); | |
1382 if (GCTimeLimit == 100) { | |
1383 // Turn off gc-overhead-limit-exceeded checks | |
1384 FLAG_SET_DEFAULT(UseGCOverheadLimit, false); | |
1385 } | |
1386 | |
1387 status &= verify_percentage(GCHeapFreeLimit, "GCHeapFreeLimit"); | |
1388 | |
1389 // Check user specified sharing option conflict with Parallel GC | |
1390 bool cannot_share = (UseConcMarkSweepGC || UseParallelGC || | |
1391 UseParallelOldGC || UseParNewGC || | |
1392 SOLARIS_ONLY(UseISM) NOT_SOLARIS(UseLargePages)); | |
1393 | |
1394 if (cannot_share) { | |
1395 // Either force sharing on by forcing the other options off, or | |
1396 // force sharing off. | |
1397 if (DumpSharedSpaces || ForceSharedSpaces) { | |
1398 set_serial_gc_flags(); | |
1399 FLAG_SET_DEFAULT(SOLARIS_ONLY(UseISM) NOT_SOLARIS(UseLargePages), false); | |
1400 } else { | |
1401 no_shared_spaces(); | |
1402 } | |
1403 } | |
1404 | |
1405 // Ensure that the user has not selected conflicting sets | 1302 // Ensure that the user has not selected conflicting sets |
1406 // of collectors. [Note: this check is merely a user convenience; | 1303 // of collectors. [Note: this check is merely a user convenience; |
1407 // collectors over-ride each other so that only a non-conflicting | 1304 // collectors over-ride each other so that only a non-conflicting |
1408 // set is selected; however what the user gets is not what they | 1305 // set is selected; however what the user gets is not what they |
1409 // may have expected from the combination they asked for. It's | 1306 // may have expected from the combination they asked for. It's |
1419 "please refer to the release notes for the combinations " | 1316 "please refer to the release notes for the combinations " |
1420 "allowed\n"); | 1317 "allowed\n"); |
1421 status = false; | 1318 status = false; |
1422 } | 1319 } |
1423 | 1320 |
1321 return status; | |
1322 } | |
1323 | |
1324 // Check the consistency of vm_init_args | |
1325 bool Arguments::check_vm_args_consistency() { | |
1326 // Method for adding checks for flag consistency. | |
1327 // The intent is to warn the user of all possible conflicts, | |
1328 // before returning an error. | |
1329 // Note: Needs platform-dependent factoring. | |
1330 bool status = true; | |
1331 | |
1332 #if ( (defined(COMPILER2) && defined(SPARC))) | |
1333 // NOTE: The call to VM_Version_init depends on the fact that VM_Version_init | |
1334 // on sparc doesn't require generation of a stub as is the case on, e.g., | |
1335 // x86. Normally, VM_Version_init must be called from init_globals in | |
1336 // init.cpp, which is called by the initial java thread *after* arguments | |
1337 // have been parsed. VM_Version_init gets called twice on sparc. | |
1338 extern void VM_Version_init(); | |
1339 VM_Version_init(); | |
1340 if (!VM_Version::has_v9()) { | |
1341 jio_fprintf(defaultStream::error_stream(), | |
1342 "V8 Machine detected, Server requires V9\n"); | |
1343 status = false; | |
1344 } | |
1345 #endif /* COMPILER2 && SPARC */ | |
1346 | |
1347 // Allow both -XX:-UseStackBanging and -XX:-UseBoundThreads in non-product | |
1348 // builds so the cost of stack banging can be measured. | |
1349 #if (defined(PRODUCT) && defined(SOLARIS)) | |
1350 if (!UseBoundThreads && !UseStackBanging) { | |
1351 jio_fprintf(defaultStream::error_stream(), | |
1352 "-UseStackBanging conflicts with -UseBoundThreads\n"); | |
1353 | |
1354 status = false; | |
1355 } | |
1356 #endif | |
1357 | |
1358 if (TLABRefillWasteFraction == 0) { | |
1359 jio_fprintf(defaultStream::error_stream(), | |
1360 "TLABRefillWasteFraction should be a denominator, " | |
1361 "not " SIZE_FORMAT "\n", | |
1362 TLABRefillWasteFraction); | |
1363 status = false; | |
1364 } | |
1365 | |
1366 status = status && verify_percentage(MaxLiveObjectEvacuationRatio, | |
1367 "MaxLiveObjectEvacuationRatio"); | |
1368 status = status && verify_percentage(AdaptiveSizePolicyWeight, | |
1369 "AdaptiveSizePolicyWeight"); | |
1370 status = status && verify_percentage(AdaptivePermSizeWeight, "AdaptivePermSizeWeight"); | |
1371 status = status && verify_percentage(ThresholdTolerance, "ThresholdTolerance"); | |
1372 status = status && verify_percentage(MinHeapFreeRatio, "MinHeapFreeRatio"); | |
1373 status = status && verify_percentage(MaxHeapFreeRatio, "MaxHeapFreeRatio"); | |
1374 | |
1375 if (MinHeapFreeRatio > MaxHeapFreeRatio) { | |
1376 jio_fprintf(defaultStream::error_stream(), | |
1377 "MinHeapFreeRatio (" UINTX_FORMAT ") must be less than or " | |
1378 "equal to MaxHeapFreeRatio (" UINTX_FORMAT ")\n", | |
1379 MinHeapFreeRatio, MaxHeapFreeRatio); | |
1380 status = false; | |
1381 } | |
1382 // Keeping the heap 100% free is hard ;-) so limit it to 99%. | |
1383 MinHeapFreeRatio = MIN2(MinHeapFreeRatio, (uintx) 99); | |
1384 | |
1385 if (FullGCALot && FLAG_IS_DEFAULT(MarkSweepAlwaysCompactCount)) { | |
1386 MarkSweepAlwaysCompactCount = 1; // Move objects every gc. | |
1387 } | |
1388 | |
1389 status = status && verify_percentage(GCHeapFreeLimit, "GCHeapFreeLimit"); | |
1390 status = status && verify_percentage(GCTimeLimit, "GCTimeLimit"); | |
1391 if (GCTimeLimit == 100) { | |
1392 // Turn off gc-overhead-limit-exceeded checks | |
1393 FLAG_SET_DEFAULT(UseGCOverheadLimit, false); | |
1394 } | |
1395 | |
1396 status = status && verify_percentage(GCHeapFreeLimit, "GCHeapFreeLimit"); | |
1397 | |
1398 // Check user specified sharing option conflict with Parallel GC | |
1399 bool cannot_share = (UseConcMarkSweepGC || UseParallelGC || | |
1400 UseParallelOldGC || UseParNewGC || | |
1401 SOLARIS_ONLY(UseISM) NOT_SOLARIS(UseLargePages)); | |
1402 | |
1403 if (cannot_share) { | |
1404 // Either force sharing on by forcing the other options off, or | |
1405 // force sharing off. | |
1406 if (DumpSharedSpaces || ForceSharedSpaces) { | |
1407 set_serial_gc_flags(); | |
1408 FLAG_SET_DEFAULT(SOLARIS_ONLY(UseISM) NOT_SOLARIS(UseLargePages), false); | |
1409 } else { | |
1410 no_shared_spaces(); | |
1411 } | |
1412 } | |
1413 | |
1414 status = status && check_gc_consistency(); | |
1415 | |
1424 if (_has_alloc_profile) { | 1416 if (_has_alloc_profile) { |
1425 if (UseParallelGC || UseParallelOldGC) { | 1417 if (UseParallelGC || UseParallelOldGC) { |
1426 jio_fprintf(defaultStream::error_stream(), | 1418 jio_fprintf(defaultStream::error_stream(), |
1427 "error: invalid argument combination.\n" | 1419 "error: invalid argument combination.\n" |
1428 "Allocation profiling (-Xaprof) cannot be used together with " | 1420 "Allocation profiling (-Xaprof) cannot be used together with " |
1449 jio_fprintf(defaultStream::error_stream(), | 1441 jio_fprintf(defaultStream::error_stream(), |
1450 "error: CMSIncrementalMode requires thread-local " | 1442 "error: CMSIncrementalMode requires thread-local " |
1451 "allocation buffers\n(-XX:+UseTLAB).\n"); | 1443 "allocation buffers\n(-XX:+UseTLAB).\n"); |
1452 status = false; | 1444 status = false; |
1453 } else { | 1445 } else { |
1454 status &= verify_percentage(CMSIncrementalDutyCycle, | 1446 status = status && verify_percentage(CMSIncrementalDutyCycle, |
1455 "CMSIncrementalDutyCycle"); | 1447 "CMSIncrementalDutyCycle"); |
1456 status &= verify_percentage(CMSIncrementalDutyCycleMin, | 1448 status = status && verify_percentage(CMSIncrementalDutyCycleMin, |
1457 "CMSIncrementalDutyCycleMin"); | 1449 "CMSIncrementalDutyCycleMin"); |
1458 status &= verify_percentage(CMSIncrementalSafetyFactor, | 1450 status = status && verify_percentage(CMSIncrementalSafetyFactor, |
1459 "CMSIncrementalSafetyFactor"); | 1451 "CMSIncrementalSafetyFactor"); |
1460 status &= verify_percentage(CMSIncrementalOffset, | 1452 status = status && verify_percentage(CMSIncrementalOffset, |
1461 "CMSIncrementalOffset"); | 1453 "CMSIncrementalOffset"); |
1462 status &= verify_percentage(CMSExpAvgFactor, | 1454 status = status && verify_percentage(CMSExpAvgFactor, |
1463 "CMSExpAvgFactor"); | 1455 "CMSExpAvgFactor"); |
1464 // If it was not set on the command line, set | 1456 // If it was not set on the command line, set |
1465 // CMSInitiatingOccupancyFraction to 1 so icms can initiate cycles early. | 1457 // CMSInitiatingOccupancyFraction to 1 so icms can initiate cycles early. |
1466 if (CMSInitiatingOccupancyFraction < 0) { | 1458 if (CMSInitiatingOccupancyFraction < 0) { |
1467 FLAG_SET_DEFAULT(CMSInitiatingOccupancyFraction, 1); | 1459 FLAG_SET_DEFAULT(CMSInitiatingOccupancyFraction, 1); |
2062 // See runtime/compilationPolicy.*. | 2054 // See runtime/compilationPolicy.*. |
2063 FLAG_SET_CMDLINE(intx, CompilationPolicyChoice, 0); | 2055 FLAG_SET_CMDLINE(intx, CompilationPolicyChoice, 0); |
2064 | 2056 |
2065 // Enable parallel GC and adaptive generation sizing | 2057 // Enable parallel GC and adaptive generation sizing |
2066 FLAG_SET_CMDLINE(bool, UseParallelGC, true); | 2058 FLAG_SET_CMDLINE(bool, UseParallelGC, true); |
2067 FLAG_SET_DEFAULT(ParallelGCThreads, nof_parallel_gc_threads()); | 2059 FLAG_SET_DEFAULT(ParallelGCThreads, |
2060 Abstract_VM_Version::parallel_worker_threads()); | |
2068 | 2061 |
2069 // Encourage steady state memory management | 2062 // Encourage steady state memory management |
2070 FLAG_SET_CMDLINE(uintx, ThresholdTolerance, 100); | 2063 FLAG_SET_CMDLINE(uintx, ThresholdTolerance, 100); |
2071 | 2064 |
2072 // This appears to improve mutator locality | 2065 // This appears to improve mutator locality |
2449 #endif // SERIALGC | 2442 #endif // SERIALGC |
2450 #ifdef KERNEL | 2443 #ifdef KERNEL |
2451 no_shared_spaces(); | 2444 no_shared_spaces(); |
2452 #endif // KERNEL | 2445 #endif // KERNEL |
2453 | 2446 |
2454 // Set some flags for ParallelGC if needed. | |
2455 set_parallel_gc_flags(); | |
2456 | |
2457 // Set some flags for CMS and/or ParNew collectors, as needed. | |
2458 set_cms_and_parnew_gc_flags(); | |
2459 | |
2460 // Set flags based on ergonomics. | 2447 // Set flags based on ergonomics. |
2461 set_ergonomics_flags(); | 2448 set_ergonomics_flags(); |
2449 | |
2450 // Check the GC selections again. | |
2451 if (!check_gc_consistency()) { | |
2452 return JNI_EINVAL; | |
2453 } | |
2454 | |
2455 if (UseParallelGC) { | |
2456 // Set some flags for ParallelGC if needed. | |
2457 set_parallel_gc_flags(); | |
2458 } else if (UseConcMarkSweepGC) { | |
2459 // Set some flags for CMS | |
2460 set_cms_and_parnew_gc_flags(); | |
2461 } else if (UseParNewGC) { | |
2462 // Set some flags for ParNew | |
2463 set_parnew_gc_flags(); | |
2464 } | |
2462 | 2465 |
2463 #ifdef SERIALGC | 2466 #ifdef SERIALGC |
2464 assert(verify_serial_gc_flags(), "SerialGC unset"); | 2467 assert(verify_serial_gc_flags(), "SerialGC unset"); |
2465 #endif // SERIALGC | 2468 #endif // SERIALGC |
2466 | 2469 |
2476 #endif /* CC_INTERP */ | 2479 #endif /* CC_INTERP */ |
2477 | 2480 |
2478 if (PrintCommandLineFlags) { | 2481 if (PrintCommandLineFlags) { |
2479 CommandLineFlags::printSetFlags(); | 2482 CommandLineFlags::printSetFlags(); |
2480 } | 2483 } |
2484 | |
2485 #ifdef ASSERT | |
2486 if (PrintFlagsFinal) { | |
2487 CommandLineFlags::printFlags(); | |
2488 } | |
2489 #endif | |
2481 | 2490 |
2482 return JNI_OK; | 2491 return JNI_OK; |
2483 } | 2492 } |
2484 | 2493 |
2485 int Arguments::PropertyList_count(SystemProperty* pl) { | 2494 int Arguments::PropertyList_count(SystemProperty* pl) { |