Mercurial > hg > truffle
comparison src/share/vm/runtime/arguments.cpp @ 342:37f87013dfd8
6711316: Open source the Garbage-First garbage collector
Summary: First mercurial integration of the code for the Garbage-First garbage collector.
Reviewed-by: apetrusenko, iveresov, jmasa, sgoldman, tonyp, ysr
author | ysr |
---|---|
date | Thu, 05 Jun 2008 15:57:56 -0700 |
parents | b7268662a986 |
children | 6aae2f9d0294 |
comparison
equal
deleted
inserted
replaced
189:0b27f3512f9e | 342:37f87013dfd8 |
---|---|
920 // If the user has chosen ParallelGCThreads > 0, we set UseParNewGC | 920 // If the user has chosen ParallelGCThreads > 0, we set UseParNewGC |
921 // if it's not explictly set or unset. If the user has chosen | 921 // if it's not explictly set or unset. If the user has chosen |
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 && !UseG1GC, |
926 "control point invariant"); | |
927 assert(UseParNewGC, "Error"); | |
926 | 928 |
927 // Turn off AdaptiveSizePolicy by default for parnew until it is | 929 // Turn off AdaptiveSizePolicy by default for parnew until it is |
928 // complete. | 930 // complete. |
929 if (UseParNewGC && | 931 if (FLAG_IS_DEFAULT(UseAdaptiveSizePolicy)) { |
930 FLAG_IS_DEFAULT(UseAdaptiveSizePolicy)) { | |
931 FLAG_SET_DEFAULT(UseAdaptiveSizePolicy, false); | 932 FLAG_SET_DEFAULT(UseAdaptiveSizePolicy, false); |
932 } | 933 } |
933 | 934 |
934 if (FLAG_IS_DEFAULT(UseParNewGC) && ParallelGCThreads > 1) { | 935 if (ParallelGCThreads == 0) { |
935 FLAG_SET_DEFAULT(UseParNewGC, true); | |
936 } else if (UseParNewGC && ParallelGCThreads == 0) { | |
937 FLAG_SET_DEFAULT(ParallelGCThreads, | 936 FLAG_SET_DEFAULT(ParallelGCThreads, |
938 Abstract_VM_Version::parallel_worker_threads()); | 937 Abstract_VM_Version::parallel_worker_threads()); |
939 if (FLAG_IS_DEFAULT(ParallelGCThreads) && ParallelGCThreads == 1) { | 938 if (FLAG_IS_DEFAULT(ParallelGCThreads) && ParallelGCThreads == 1) { |
940 FLAG_SET_DEFAULT(UseParNewGC, false); | 939 FLAG_SET_DEFAULT(UseParNewGC, false); |
941 } | 940 } |
967 // Adjust some sizes to suit CMS and/or ParNew needs; these work well on | 966 // Adjust some sizes to suit CMS and/or ParNew needs; these work well on |
968 // sparc/solaris for certain applications, but would gain from | 967 // sparc/solaris for certain applications, but would gain from |
969 // further optimization and tuning efforts, and would almost | 968 // further optimization and tuning efforts, and would almost |
970 // certainly gain from analysis of platform and environment. | 969 // certainly gain from analysis of platform and environment. |
971 void Arguments::set_cms_and_parnew_gc_flags() { | 970 void Arguments::set_cms_and_parnew_gc_flags() { |
972 if (UseSerialGC || UseParallelGC) { | 971 assert(!UseSerialGC && !UseParallelGC, "Error"); |
973 return; | |
974 } | |
975 | |
976 assert(UseConcMarkSweepGC, "CMS is expected to be on here"); | 972 assert(UseConcMarkSweepGC, "CMS is expected to be on here"); |
977 | 973 |
978 // If we are using CMS, we prefer to UseParNewGC, | 974 // If we are using CMS, we prefer to UseParNewGC, |
979 // unless explicitly forbidden. | 975 // unless explicitly forbidden. |
980 if (!UseParNewGC && FLAG_IS_DEFAULT(UseParNewGC)) { | 976 if (FLAG_IS_DEFAULT(UseParNewGC)) { |
981 FLAG_SET_ERGO(bool, UseParNewGC, true); | 977 FLAG_SET_ERGO(bool, UseParNewGC, true); |
982 } | 978 } |
983 | 979 |
984 // Turn off AdaptiveSizePolicy by default for cms until it is | 980 // Turn off AdaptiveSizePolicy by default for cms until it is |
985 // complete. | 981 // complete. |
1155 // If no other collector is requested explicitly, | 1151 // If no other collector is requested explicitly, |
1156 // let the VM select the collector based on | 1152 // let the VM select the collector based on |
1157 // machine class and automatic selection policy. | 1153 // machine class and automatic selection policy. |
1158 if (!UseSerialGC && | 1154 if (!UseSerialGC && |
1159 !UseConcMarkSweepGC && | 1155 !UseConcMarkSweepGC && |
1156 !UseG1GC && | |
1160 !UseParNewGC && | 1157 !UseParNewGC && |
1161 !DumpSharedSpaces && | 1158 !DumpSharedSpaces && |
1162 FLAG_IS_DEFAULT(UseParallelGC)) { | 1159 FLAG_IS_DEFAULT(UseParallelGC)) { |
1163 if (should_auto_select_low_pause_collector()) { | 1160 if (should_auto_select_low_pause_collector()) { |
1164 FLAG_SET_ERGO(bool, UseConcMarkSweepGC, true); | 1161 FLAG_SET_ERGO(bool, UseConcMarkSweepGC, true); |
1172 #ifdef _LP64 | 1169 #ifdef _LP64 |
1173 // Compressed Headers do not work with CMS, which uses a bit in the klass | 1170 // Compressed Headers do not work with CMS, which uses a bit in the klass |
1174 // field offset to determine free list chunk markers. | 1171 // field offset to determine free list chunk markers. |
1175 // Check that UseCompressedOops can be set with the max heap size allocated | 1172 // Check that UseCompressedOops can be set with the max heap size allocated |
1176 // by ergonomics. | 1173 // by ergonomics. |
1177 if (!UseConcMarkSweepGC && MaxHeapSize <= max_heap_for_compressed_oops()) { | 1174 if (!UseG1GC && !UseConcMarkSweepGC && MaxHeapSize <= max_heap_for_compressed_oops()) { |
1178 if (FLAG_IS_DEFAULT(UseCompressedOops)) { | 1175 if (FLAG_IS_DEFAULT(UseCompressedOops)) { |
1179 FLAG_SET_ERGO(bool, UseCompressedOops, true); | 1176 FLAG_SET_ERGO(bool, UseCompressedOops, true); |
1180 } | 1177 } |
1181 } else { | 1178 } else { |
1182 if (UseCompressedOops && !FLAG_IS_DEFAULT(UseCompressedOops)) { | 1179 if (UseCompressedOops && !FLAG_IS_DEFAULT(UseCompressedOops)) { |
1183 // If specified, give a warning | 1180 // If specified, give a warning |
1184 if (UseConcMarkSweepGC){ | 1181 if (UseConcMarkSweepGC){ |
1185 warning("Compressed Oops does not work with CMS"); | 1182 warning("Compressed Oops does not work with CMS"); |
1183 } else if (UseG1GC) { | |
1184 warning("Compressed Oops does not work with UseG1GC"); | |
1186 } else { | 1185 } else { |
1187 warning( | 1186 warning( |
1188 "Max heap size too large for Compressed Oops"); | 1187 "Max heap size too large for Compressed Oops"); |
1189 } | 1188 } |
1190 FLAG_SET_DEFAULT(UseCompressedOops, false); | 1189 FLAG_SET_DEFAULT(UseCompressedOops, false); |
1194 // in vm_version initialization code. | 1193 // in vm_version initialization code. |
1195 #endif // _LP64 | 1194 #endif // _LP64 |
1196 } | 1195 } |
1197 | 1196 |
1198 void Arguments::set_parallel_gc_flags() { | 1197 void Arguments::set_parallel_gc_flags() { |
1198 assert(UseParallelGC || UseParallelOldGC, "Error"); | |
1199 // If parallel old was requested, automatically enable parallel scavenge. | 1199 // If parallel old was requested, automatically enable parallel scavenge. |
1200 if (UseParallelOldGC && !UseParallelGC && FLAG_IS_DEFAULT(UseParallelGC)) { | 1200 if (UseParallelOldGC && !UseParallelGC && FLAG_IS_DEFAULT(UseParallelGC)) { |
1201 FLAG_SET_DEFAULT(UseParallelGC, true); | 1201 FLAG_SET_DEFAULT(UseParallelGC, true); |
1202 } | 1202 } |
1203 | 1203 |
1205 // of the physical memory, up to a maximum of 1GB. | 1205 // of the physical memory, up to a maximum of 1GB. |
1206 if (UseParallelGC) { | 1206 if (UseParallelGC) { |
1207 FLAG_SET_ERGO(uintx, ParallelGCThreads, | 1207 FLAG_SET_ERGO(uintx, ParallelGCThreads, |
1208 Abstract_VM_Version::parallel_worker_threads()); | 1208 Abstract_VM_Version::parallel_worker_threads()); |
1209 | 1209 |
1210 if (FLAG_IS_DEFAULT(MaxHeapSize)) { | 1210 // PS is a server collector, setup the heap sizes accordingly. |
1211 const uint64_t reasonable_fraction = | 1211 set_server_heap_size(); |
1212 os::physical_memory() / DefaultMaxRAMFraction; | |
1213 const uint64_t maximum_size = (uint64_t) | |
1214 (FLAG_IS_DEFAULT(DefaultMaxRAM) && UseCompressedOops ? | |
1215 MIN2(max_heap_for_compressed_oops(), DefaultMaxRAM) : | |
1216 DefaultMaxRAM); | |
1217 size_t reasonable_max = | |
1218 (size_t) os::allocatable_physical_memory(reasonable_fraction); | |
1219 if (reasonable_max > maximum_size) { | |
1220 reasonable_max = maximum_size; | |
1221 } | |
1222 if (PrintGCDetails && Verbose) { | |
1223 // Cannot use gclog_or_tty yet. | |
1224 tty->print_cr(" Max heap size for server class platform " | |
1225 SIZE_FORMAT, reasonable_max); | |
1226 } | |
1227 // If the initial_heap_size has not been set with -Xms, | |
1228 // then set it as fraction of size of physical memory | |
1229 // respecting the maximum and minimum sizes of the heap. | |
1230 if (initial_heap_size() == 0) { | |
1231 const uint64_t reasonable_initial_fraction = | |
1232 os::physical_memory() / DefaultInitialRAMFraction; | |
1233 const size_t reasonable_initial = | |
1234 (size_t) os::allocatable_physical_memory(reasonable_initial_fraction); | |
1235 const size_t minimum_size = NewSize + OldSize; | |
1236 set_initial_heap_size(MAX2(MIN2(reasonable_initial, reasonable_max), | |
1237 minimum_size)); | |
1238 // Currently the minimum size and the initial heap sizes are the same. | |
1239 set_min_heap_size(initial_heap_size()); | |
1240 if (PrintGCDetails && Verbose) { | |
1241 // Cannot use gclog_or_tty yet. | |
1242 tty->print_cr(" Initial heap size for server class platform " | |
1243 SIZE_FORMAT, initial_heap_size()); | |
1244 } | |
1245 } else { | |
1246 // An minimum size was specified on the command line. Be sure | |
1247 // that the maximum size is consistent. | |
1248 if (initial_heap_size() > reasonable_max) { | |
1249 reasonable_max = initial_heap_size(); | |
1250 } | |
1251 } | |
1252 FLAG_SET_ERGO(uintx, MaxHeapSize, (uintx) reasonable_max); | |
1253 } | |
1254 | |
1255 // If InitialSurvivorRatio or MinSurvivorRatio were not specified, but the | 1212 // If InitialSurvivorRatio or MinSurvivorRatio were not specified, but the |
1256 // SurvivorRatio has been set, reset their default values to SurvivorRatio + | 1213 // SurvivorRatio has been set, reset their default values to SurvivorRatio + |
1257 // 2. By doing this we make SurvivorRatio also work for Parallel Scavenger. | 1214 // 2. By doing this we make SurvivorRatio also work for Parallel Scavenger. |
1258 // See CR 6362902 for details. | 1215 // See CR 6362902 for details. |
1259 if (!FLAG_IS_DEFAULT(SurvivorRatio)) { | 1216 if (!FLAG_IS_DEFAULT(SurvivorRatio)) { |
1277 } | 1234 } |
1278 } | 1235 } |
1279 } | 1236 } |
1280 } | 1237 } |
1281 | 1238 |
1239 void Arguments::set_g1_gc_flags() { | |
1240 assert(UseG1GC, "Error"); | |
1241 // G1 is a server collector, setup the heap sizes accordingly. | |
1242 set_server_heap_size(); | |
1243 #ifdef COMPILER1 | |
1244 FastTLABRefill = false; | |
1245 #endif | |
1246 FLAG_SET_DEFAULT(ParallelGCThreads, | |
1247 Abstract_VM_Version::parallel_worker_threads()); | |
1248 if (ParallelGCThreads == 0) { | |
1249 FLAG_SET_DEFAULT(ParallelGCThreads, | |
1250 Abstract_VM_Version::parallel_worker_threads | |
1251 ()); | |
1252 } | |
1253 no_shared_spaces(); | |
1254 } | |
1255 | |
1256 void Arguments::set_server_heap_size() { | |
1257 if (FLAG_IS_DEFAULT(MaxHeapSize)) { | |
1258 const uint64_t reasonable_fraction = | |
1259 os::physical_memory() / DefaultMaxRAMFraction; | |
1260 const uint64_t maximum_size = (uint64_t) | |
1261 (FLAG_IS_DEFAULT(DefaultMaxRAM) && UseCompressedOops ? | |
1262 MIN2(max_heap_for_compressed_oops(), DefaultMaxRAM) : | |
1263 DefaultMaxRAM); | |
1264 size_t reasonable_max = | |
1265 (size_t) os::allocatable_physical_memory(reasonable_fraction); | |
1266 if (reasonable_max > maximum_size) { | |
1267 reasonable_max = maximum_size; | |
1268 } | |
1269 if (PrintGCDetails && Verbose) { | |
1270 // Cannot use gclog_or_tty yet. | |
1271 tty->print_cr(" Max heap size for server class platform " | |
1272 SIZE_FORMAT, reasonable_max); | |
1273 } | |
1274 // If the initial_heap_size has not been set with -Xms, | |
1275 // then set it as fraction of size of physical memory | |
1276 // respecting the maximum and minimum sizes of the heap. | |
1277 if (initial_heap_size() == 0) { | |
1278 const uint64_t reasonable_initial_fraction = | |
1279 os::physical_memory() / DefaultInitialRAMFraction; | |
1280 const size_t reasonable_initial = | |
1281 (size_t) os::allocatable_physical_memory(reasonable_initial_fraction); | |
1282 const size_t minimum_size = NewSize + OldSize; | |
1283 set_initial_heap_size(MAX2(MIN2(reasonable_initial, reasonable_max), | |
1284 minimum_size)); | |
1285 // Currently the minimum size and the initial heap sizes are the same. | |
1286 set_min_heap_size(initial_heap_size()); | |
1287 if (PrintGCDetails && Verbose) { | |
1288 // Cannot use gclog_or_tty yet. | |
1289 tty->print_cr(" Initial heap size for server class platform " | |
1290 SIZE_FORMAT, initial_heap_size()); | |
1291 } | |
1292 } else { | |
1293 // A minimum size was specified on the command line. Be sure | |
1294 // that the maximum size is consistent. | |
1295 if (initial_heap_size() > reasonable_max) { | |
1296 reasonable_max = initial_heap_size(); | |
1297 } | |
1298 } | |
1299 FLAG_SET_ERGO(uintx, MaxHeapSize, (uintx) reasonable_max); | |
1300 } | |
1301 } | |
1302 | |
1282 // This must be called after ergonomics because we want bytecode rewriting | 1303 // This must be called after ergonomics because we want bytecode rewriting |
1283 // if the server compiler is used, or if UseSharedSpaces is disabled. | 1304 // if the server compiler is used, or if UseSharedSpaces is disabled. |
1284 void Arguments::set_bytecode_flags() { | 1305 void Arguments::set_bytecode_flags() { |
1285 // Better not attempt to store into a read-only space. | 1306 // Better not attempt to store into a read-only space. |
1286 if (UseSharedSpaces) { | 1307 if (UseSharedSpaces) { |
1360 FLAG_SET_DEFAULT(UseSerialGC, true); | 1381 FLAG_SET_DEFAULT(UseSerialGC, true); |
1361 FLAG_SET_DEFAULT(UseParNewGC, false); | 1382 FLAG_SET_DEFAULT(UseParNewGC, false); |
1362 FLAG_SET_DEFAULT(UseConcMarkSweepGC, false); | 1383 FLAG_SET_DEFAULT(UseConcMarkSweepGC, false); |
1363 FLAG_SET_DEFAULT(UseParallelGC, false); | 1384 FLAG_SET_DEFAULT(UseParallelGC, false); |
1364 FLAG_SET_DEFAULT(UseParallelOldGC, false); | 1385 FLAG_SET_DEFAULT(UseParallelOldGC, false); |
1386 FLAG_SET_DEFAULT(UseG1GC, false); | |
1365 } | 1387 } |
1366 | 1388 |
1367 static bool verify_serial_gc_flags() { | 1389 static bool verify_serial_gc_flags() { |
1368 return (UseSerialGC && | 1390 return (UseSerialGC && |
1369 !(UseParNewGC || UseConcMarkSweepGC || UseParallelGC || | 1391 !(UseParNewGC || UseConcMarkSweepGC || UseG1GC || |
1370 UseParallelOldGC)); | 1392 UseParallelGC || UseParallelOldGC)); |
1371 } | 1393 } |
1372 | 1394 |
1373 // Check consistency of GC selection | 1395 // Check consistency of GC selection |
1374 bool Arguments::check_gc_consistency() { | 1396 bool Arguments::check_gc_consistency() { |
1375 bool status = true; | 1397 bool status = true; |
1468 } | 1490 } |
1469 | 1491 |
1470 status = status && verify_percentage(GCHeapFreeLimit, "GCHeapFreeLimit"); | 1492 status = status && verify_percentage(GCHeapFreeLimit, "GCHeapFreeLimit"); |
1471 | 1493 |
1472 // Check user specified sharing option conflict with Parallel GC | 1494 // Check user specified sharing option conflict with Parallel GC |
1473 bool cannot_share = (UseConcMarkSweepGC || UseParallelGC || | 1495 bool cannot_share = (UseConcMarkSweepGC || UseG1GC || UseParNewGC || |
1474 UseParallelOldGC || UseParNewGC || | 1496 UseParallelGC || UseParallelOldGC || |
1475 SOLARIS_ONLY(UseISM) NOT_SOLARIS(UseLargePages)); | 1497 SOLARIS_ONLY(UseISM) NOT_SOLARIS(UseLargePages)); |
1476 | 1498 |
1477 if (cannot_share) { | 1499 if (cannot_share) { |
1478 // Either force sharing on by forcing the other options off, or | 1500 // Either force sharing on by forcing the other options off, or |
1479 // force sharing off. | 1501 // force sharing off. |
1508 if (!UseConcMarkSweepGC) { | 1530 if (!UseConcMarkSweepGC) { |
1509 jio_fprintf(defaultStream::error_stream(), | 1531 jio_fprintf(defaultStream::error_stream(), |
1510 "error: invalid argument combination.\n" | 1532 "error: invalid argument combination.\n" |
1511 "The CMS collector (-XX:+UseConcMarkSweepGC) must be " | 1533 "The CMS collector (-XX:+UseConcMarkSweepGC) must be " |
1512 "selected in order\nto use CMSIncrementalMode.\n"); | 1534 "selected in order\nto use CMSIncrementalMode.\n"); |
1513 status = false; | |
1514 } else if (!UseTLAB) { | |
1515 jio_fprintf(defaultStream::error_stream(), | |
1516 "error: CMSIncrementalMode requires thread-local " | |
1517 "allocation buffers\n(-XX:+UseTLAB).\n"); | |
1518 status = false; | 1535 status = false; |
1519 } else { | 1536 } else { |
1520 status = status && verify_percentage(CMSIncrementalDutyCycle, | 1537 status = status && verify_percentage(CMSIncrementalDutyCycle, |
1521 "CMSIncrementalDutyCycle"); | 1538 "CMSIncrementalDutyCycle"); |
1522 status = status && verify_percentage(CMSIncrementalDutyCycleMin, | 1539 status = status && verify_percentage(CMSIncrementalDutyCycleMin, |
1531 // CMSInitiatingOccupancyFraction to 1 so icms can initiate cycles early. | 1548 // CMSInitiatingOccupancyFraction to 1 so icms can initiate cycles early. |
1532 if (CMSInitiatingOccupancyFraction < 0) { | 1549 if (CMSInitiatingOccupancyFraction < 0) { |
1533 FLAG_SET_DEFAULT(CMSInitiatingOccupancyFraction, 1); | 1550 FLAG_SET_DEFAULT(CMSInitiatingOccupancyFraction, 1); |
1534 } | 1551 } |
1535 } | 1552 } |
1536 } | |
1537 | |
1538 if (UseNUMA && !UseTLAB) { | |
1539 jio_fprintf(defaultStream::error_stream(), | |
1540 "error: NUMA allocator (-XX:+UseNUMA) requires thread-local " | |
1541 "allocation\nbuffers (-XX:+UseTLAB).\n"); | |
1542 status = false; | |
1543 } | 1553 } |
1544 | 1554 |
1545 // CMS space iteration, which FLSVerifyAllHeapreferences entails, | 1555 // CMS space iteration, which FLSVerifyAllHeapreferences entails, |
1546 // insists that we hold the requisite locks so that the iteration is | 1556 // insists that we hold the requisite locks so that the iteration is |
1547 // MT-safe. For the verification at start-up and shut-down, we don't | 1557 // MT-safe. For the verification at start-up and shut-down, we don't |
2328 // Java heap and the code cache. | 2338 // Java heap and the code cache. |
2329 FLAG_SET_DEFAULT(UseLargePages, false); | 2339 FLAG_SET_DEFAULT(UseLargePages, false); |
2330 SOLARIS_ONLY(FLAG_SET_DEFAULT(UseMPSS, false)); | 2340 SOLARIS_ONLY(FLAG_SET_DEFAULT(UseMPSS, false)); |
2331 SOLARIS_ONLY(FLAG_SET_DEFAULT(UseISM, false)); | 2341 SOLARIS_ONLY(FLAG_SET_DEFAULT(UseISM, false)); |
2332 } | 2342 } |
2343 | |
2333 #else | 2344 #else |
2334 if (!FLAG_IS_DEFAULT(OptoLoopAlignment) && FLAG_IS_DEFAULT(MaxLoopPad)) { | 2345 if (!FLAG_IS_DEFAULT(OptoLoopAlignment) && FLAG_IS_DEFAULT(MaxLoopPad)) { |
2335 FLAG_SET_DEFAULT(MaxLoopPad, OptoLoopAlignment-1); | 2346 FLAG_SET_DEFAULT(MaxLoopPad, OptoLoopAlignment-1); |
2347 } | |
2348 // Temporary disable bulk zeroing reduction with G1. See CR 6627983. | |
2349 if (UseG1GC) { | |
2350 FLAG_SET_DEFAULT(ReduceBulkZeroing, false); | |
2336 } | 2351 } |
2337 #endif | 2352 #endif |
2338 | 2353 |
2339 if (!check_vm_args_consistency()) { | 2354 if (!check_vm_args_consistency()) { |
2340 return JNI_ERR; | 2355 return JNI_ERR; |
2483 logOption(tail); | 2498 logOption(tail); |
2484 } | 2499 } |
2485 } | 2500 } |
2486 } | 2501 } |
2487 | 2502 |
2503 | |
2488 // Parse JavaVMInitArgs structure passed in, as well as JAVA_TOOL_OPTIONS and _JAVA_OPTIONS | 2504 // Parse JavaVMInitArgs structure passed in, as well as JAVA_TOOL_OPTIONS and _JAVA_OPTIONS |
2489 jint result = parse_vm_init_args(args); | 2505 jint result = parse_vm_init_args(args); |
2490 if (result != JNI_OK) { | 2506 if (result != JNI_OK) { |
2491 return result; | 2507 return result; |
2508 } | |
2509 | |
2510 // These are hacks until G1 is fully supported and tested | |
2511 // but lets you force -XX:+UseG1GC in PRT and get it where it (mostly) works | |
2512 if (UseG1GC) { | |
2513 if (UseConcMarkSweepGC || UseParNewGC || UseParallelGC || UseParallelOldGC || UseSerialGC) { | |
2514 #ifndef PRODUCT | |
2515 tty->print_cr("-XX:+UseG1GC is incompatible with other collectors, using UseG1GC"); | |
2516 #endif // PRODUCT | |
2517 UseConcMarkSweepGC = false; | |
2518 UseParNewGC = false; | |
2519 UseParallelGC = false; | |
2520 UseParallelOldGC = false; | |
2521 UseSerialGC = false; | |
2522 } | |
2523 no_shared_spaces(); | |
2492 } | 2524 } |
2493 | 2525 |
2494 #ifndef PRODUCT | 2526 #ifndef PRODUCT |
2495 if (TraceBytecodesAt != 0) { | 2527 if (TraceBytecodesAt != 0) { |
2496 TraceBytecodes = true; | 2528 TraceBytecodes = true; |
2533 // Set some flags for CMS | 2565 // Set some flags for CMS |
2534 set_cms_and_parnew_gc_flags(); | 2566 set_cms_and_parnew_gc_flags(); |
2535 } else if (UseParNewGC) { | 2567 } else if (UseParNewGC) { |
2536 // Set some flags for ParNew | 2568 // Set some flags for ParNew |
2537 set_parnew_gc_flags(); | 2569 set_parnew_gc_flags(); |
2570 } | |
2571 // Temporary; make the "if" an "else-if" before | |
2572 // we integrate G1. XXX | |
2573 if (UseG1GC) { | |
2574 // Set some flags for garbage-first, if needed. | |
2575 set_g1_gc_flags(); | |
2538 } | 2576 } |
2539 | 2577 |
2540 #ifdef SERIALGC | 2578 #ifdef SERIALGC |
2541 assert(verify_serial_gc_flags(), "SerialGC unset"); | 2579 assert(verify_serial_gc_flags(), "SerialGC unset"); |
2542 #endif // SERIALGC | 2580 #endif // SERIALGC |