Mercurial > hg > graal-compiler
comparison src/share/vm/runtime/arguments.cpp @ 8883:b9a918201d47
Merge with hsx25
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Sat, 06 Apr 2013 20:04:06 +0200 |
parents | c92949b1ec8a 0c039865ef2b |
children | 89e4d67fdd2a |
comparison
equal
deleted
inserted
replaced
8660:d47b52b0ff68 | 8883:b9a918201d47 |
---|---|
262 { "MinPermHeapExpansion", JDK_Version::jdk(8), JDK_Version::jdk(9) }, | 262 { "MinPermHeapExpansion", JDK_Version::jdk(8), JDK_Version::jdk(9) }, |
263 { "MaxPermHeapExpansion", JDK_Version::jdk(8), JDK_Version::jdk(9) }, | 263 { "MaxPermHeapExpansion", JDK_Version::jdk(8), JDK_Version::jdk(9) }, |
264 { "CMSRevisitStackSize", JDK_Version::jdk(8), JDK_Version::jdk(9) }, | 264 { "CMSRevisitStackSize", JDK_Version::jdk(8), JDK_Version::jdk(9) }, |
265 { "PrintRevisitStats", JDK_Version::jdk(8), JDK_Version::jdk(9) }, | 265 { "PrintRevisitStats", JDK_Version::jdk(8), JDK_Version::jdk(9) }, |
266 { "UseVectoredExceptions", JDK_Version::jdk(8), JDK_Version::jdk(9) }, | 266 { "UseVectoredExceptions", JDK_Version::jdk(8), JDK_Version::jdk(9) }, |
267 { "UseSplitVerifier", JDK_Version::jdk(8), JDK_Version::jdk(9) }, | |
267 #ifdef PRODUCT | 268 #ifdef PRODUCT |
268 { "DesiredMethodLimit", | 269 { "DesiredMethodLimit", |
269 JDK_Version::jdk_update(7, 2), JDK_Version::jdk(8) }, | 270 JDK_Version::jdk_update(7, 2), JDK_Version::jdk(8) }, |
270 #endif // PRODUCT | 271 #endif // PRODUCT |
271 { NULL, JDK_Version(0), JDK_Version(0) } | 272 { NULL, JDK_Version(0), JDK_Version(0) } |
1176 // as needed. | 1177 // as needed. |
1177 if (UseParNewGC) { | 1178 if (UseParNewGC) { |
1178 set_parnew_gc_flags(); | 1179 set_parnew_gc_flags(); |
1179 } | 1180 } |
1180 | 1181 |
1181 // MaxHeapSize is aligned down in collectorPolicy | |
1182 size_t max_heap = align_size_down(MaxHeapSize, | 1182 size_t max_heap = align_size_down(MaxHeapSize, |
1183 CardTableRS::ct_max_alignment_constraint()); | 1183 CardTableRS::ct_max_alignment_constraint()); |
1184 | 1184 |
1185 // Now make adjustments for CMS | 1185 // Now make adjustments for CMS |
1186 intx tenuring_default = (intx)6; | 1186 intx tenuring_default = (intx)6; |
1214 // Too early to use gclog_or_tty | 1214 // Too early to use gclog_or_tty |
1215 tty->print_cr("CMS ergo set MaxNewSize: " SIZE_FORMAT, MaxNewSize); | 1215 tty->print_cr("CMS ergo set MaxNewSize: " SIZE_FORMAT, MaxNewSize); |
1216 } | 1216 } |
1217 | 1217 |
1218 // Code along this path potentially sets NewSize and OldSize | 1218 // Code along this path potentially sets NewSize and OldSize |
1219 | |
1220 assert(max_heap >= InitialHeapSize, "Error"); | |
1221 assert(max_heap >= NewSize, "Error"); | |
1222 | |
1223 if (PrintGCDetails && Verbose) { | 1219 if (PrintGCDetails && Verbose) { |
1224 // Too early to use gclog_or_tty | 1220 // Too early to use gclog_or_tty |
1225 tty->print_cr("CMS set min_heap_size: " SIZE_FORMAT | 1221 tty->print_cr("CMS set min_heap_size: " SIZE_FORMAT |
1226 " initial_heap_size: " SIZE_FORMAT | 1222 " initial_heap_size: " SIZE_FORMAT |
1227 " max_heap: " SIZE_FORMAT, | 1223 " max_heap: " SIZE_FORMAT, |
1388 return true; | 1384 return true; |
1389 } | 1385 } |
1390 return false; | 1386 return false; |
1391 } | 1387 } |
1392 | 1388 |
1389 void Arguments::set_use_compressed_oops() { | |
1390 #ifndef ZERO | |
1391 #ifdef _LP64 | |
1392 // MaxHeapSize is not set up properly at this point, but | |
1393 // the only value that can override MaxHeapSize if we are | |
1394 // to use UseCompressedOops is InitialHeapSize. | |
1395 size_t max_heap_size = MAX2(MaxHeapSize, InitialHeapSize); | |
1396 | |
1397 if (max_heap_size <= max_heap_for_compressed_oops()) { | |
1398 #if !defined(COMPILER1) || defined(TIERED) | |
1399 if (FLAG_IS_DEFAULT(UseCompressedOops)) { | |
1400 FLAG_SET_ERGO(bool, UseCompressedOops, true); | |
1401 } | |
1402 #endif | |
1403 #ifdef _WIN64 | |
1404 if (UseLargePages && UseCompressedOops) { | |
1405 // Cannot allocate guard pages for implicit checks in indexed addressing | |
1406 // mode, when large pages are specified on windows. | |
1407 // This flag could be switched ON if narrow oop base address is set to 0, | |
1408 // see code in Universe::initialize_heap(). | |
1409 Universe::set_narrow_oop_use_implicit_null_checks(false); | |
1410 } | |
1411 #endif // _WIN64 | |
1412 } else { | |
1413 if (UseCompressedOops && !FLAG_IS_DEFAULT(UseCompressedOops)) { | |
1414 warning("Max heap size too large for Compressed Oops"); | |
1415 FLAG_SET_DEFAULT(UseCompressedOops, false); | |
1416 FLAG_SET_DEFAULT(UseCompressedKlassPointers, false); | |
1417 } | |
1418 } | |
1419 #endif // _LP64 | |
1420 #endif // ZERO | |
1421 } | |
1422 | |
1393 void Arguments::set_ergonomics_flags() { | 1423 void Arguments::set_ergonomics_flags() { |
1394 | 1424 |
1395 if (os::is_server_class_machine()) { | 1425 if (os::is_server_class_machine()) { |
1396 // If no other collector is requested explicitly, | 1426 // If no other collector is requested explicitly, |
1397 // let the VM select the collector based on | 1427 // let the VM select the collector based on |
1417 } | 1447 } |
1418 } | 1448 } |
1419 | 1449 |
1420 #ifndef ZERO | 1450 #ifndef ZERO |
1421 #ifdef _LP64 | 1451 #ifdef _LP64 |
1422 // Check that UseCompressedOops can be set with the max heap size allocated | 1452 set_use_compressed_oops(); |
1423 // by ergonomics. | |
1424 if (MaxHeapSize <= max_heap_for_compressed_oops()) { | |
1425 #if !defined(COMPILER1) || defined(TIERED) | |
1426 if (FLAG_IS_DEFAULT(UseCompressedOops)) { | |
1427 FLAG_SET_ERGO(bool, UseCompressedOops, true); | |
1428 } | |
1429 #endif | |
1430 #ifdef _WIN64 | |
1431 if (UseLargePages && UseCompressedOops) { | |
1432 // Cannot allocate guard pages for implicit checks in indexed addressing | |
1433 // mode, when large pages are specified on windows. | |
1434 // This flag could be switched ON if narrow oop base address is set to 0, | |
1435 // see code in Universe::initialize_heap(). | |
1436 Universe::set_narrow_oop_use_implicit_null_checks(false); | |
1437 } | |
1438 #endif // _WIN64 | |
1439 } else { | |
1440 if (UseCompressedOops && !FLAG_IS_DEFAULT(UseCompressedOops)) { | |
1441 warning("Max heap size too large for Compressed Oops"); | |
1442 FLAG_SET_DEFAULT(UseCompressedOops, false); | |
1443 FLAG_SET_DEFAULT(UseCompressedKlassPointers, false); | |
1444 } | |
1445 } | |
1446 // UseCompressedOops must be on for UseCompressedKlassPointers to be on. | 1453 // UseCompressedOops must be on for UseCompressedKlassPointers to be on. |
1447 if (!UseCompressedOops) { | 1454 if (!UseCompressedOops) { |
1448 if (UseCompressedKlassPointers) { | 1455 if (UseCompressedKlassPointers) { |
1449 warning("UseCompressedKlassPointers requires UseCompressedOops"); | 1456 warning("UseCompressedKlassPointers requires UseCompressedOops"); |
1450 } | 1457 } |
1553 MarkStackSize / K, MarkStackSizeMax / K); | 1560 MarkStackSize / K, MarkStackSizeMax / K); |
1554 tty->print_cr("ConcGCThreads: %u", ConcGCThreads); | 1561 tty->print_cr("ConcGCThreads: %u", ConcGCThreads); |
1555 } | 1562 } |
1556 } | 1563 } |
1557 | 1564 |
1565 julong Arguments::limit_by_allocatable_memory(julong limit) { | |
1566 julong max_allocatable; | |
1567 julong result = limit; | |
1568 if (os::has_allocatable_memory_limit(&max_allocatable)) { | |
1569 result = MIN2(result, max_allocatable / MaxVirtMemFraction); | |
1570 } | |
1571 return result; | |
1572 } | |
1573 | |
1558 void Arguments::set_heap_size() { | 1574 void Arguments::set_heap_size() { |
1559 if (!FLAG_IS_DEFAULT(DefaultMaxRAMFraction)) { | 1575 if (!FLAG_IS_DEFAULT(DefaultMaxRAMFraction)) { |
1560 // Deprecated flag | 1576 // Deprecated flag |
1561 FLAG_SET_CMDLINE(uintx, MaxRAMFraction, DefaultMaxRAMFraction); | 1577 FLAG_SET_CMDLINE(uintx, MaxRAMFraction, DefaultMaxRAMFraction); |
1562 } | 1578 } |
1591 // but it should be not less than default MaxHeapSize. | 1607 // but it should be not less than default MaxHeapSize. |
1592 max_coop_heap -= HeapBaseMinAddress; | 1608 max_coop_heap -= HeapBaseMinAddress; |
1593 } | 1609 } |
1594 reasonable_max = MIN2(reasonable_max, max_coop_heap); | 1610 reasonable_max = MIN2(reasonable_max, max_coop_heap); |
1595 } | 1611 } |
1596 reasonable_max = os::allocatable_physical_memory(reasonable_max); | 1612 reasonable_max = limit_by_allocatable_memory(reasonable_max); |
1597 | 1613 |
1598 if (!FLAG_IS_DEFAULT(InitialHeapSize)) { | 1614 if (!FLAG_IS_DEFAULT(InitialHeapSize)) { |
1599 // An initial heap size was specified on the command line, | 1615 // An initial heap size was specified on the command line, |
1600 // so be sure that the maximum size is consistent. Done | 1616 // so be sure that the maximum size is consistent. Done |
1601 // after call to allocatable_physical_memory because that | 1617 // after call to limit_by_allocatable_memory because that |
1602 // method might reduce the allocation size. | 1618 // method might reduce the allocation size. |
1603 reasonable_max = MAX2(reasonable_max, (julong)InitialHeapSize); | 1619 reasonable_max = MAX2(reasonable_max, (julong)InitialHeapSize); |
1604 } | 1620 } |
1605 | 1621 |
1606 if (PrintGCDetails && Verbose) { | 1622 if (PrintGCDetails && Verbose) { |
1616 if (FLAG_IS_DEFAULT(InitialHeapSize)) { | 1632 if (FLAG_IS_DEFAULT(InitialHeapSize)) { |
1617 julong reasonable_minimum = (julong)(OldSize + NewSize); | 1633 julong reasonable_minimum = (julong)(OldSize + NewSize); |
1618 | 1634 |
1619 reasonable_minimum = MIN2(reasonable_minimum, (julong)MaxHeapSize); | 1635 reasonable_minimum = MIN2(reasonable_minimum, (julong)MaxHeapSize); |
1620 | 1636 |
1621 reasonable_minimum = os::allocatable_physical_memory(reasonable_minimum); | 1637 reasonable_minimum = limit_by_allocatable_memory(reasonable_minimum); |
1622 | 1638 |
1623 julong reasonable_initial = phys_mem / InitialRAMFraction; | 1639 julong reasonable_initial = phys_mem / InitialRAMFraction; |
1624 | 1640 |
1625 reasonable_initial = MAX2(reasonable_initial, reasonable_minimum); | 1641 reasonable_initial = MAX2(reasonable_initial, reasonable_minimum); |
1626 reasonable_initial = MIN2(reasonable_initial, (julong)MaxHeapSize); | 1642 reasonable_initial = MIN2(reasonable_initial, (julong)MaxHeapSize); |
1627 | 1643 |
1628 reasonable_initial = os::allocatable_physical_memory(reasonable_initial); | 1644 reasonable_initial = limit_by_allocatable_memory(reasonable_initial); |
1629 | 1645 |
1630 if (PrintGCDetails && Verbose) { | 1646 if (PrintGCDetails && Verbose) { |
1631 // Cannot use gclog_or_tty yet. | 1647 // Cannot use gclog_or_tty yet. |
1632 tty->print_cr(" Initial heap size " SIZE_FORMAT, (uintx)reasonable_initial); | 1648 tty->print_cr(" Initial heap size " SIZE_FORMAT, (uintx)reasonable_initial); |
1633 tty->print_cr(" Minimum heap size " SIZE_FORMAT, (uintx)reasonable_minimum); | 1649 tty->print_cr(" Minimum heap size " SIZE_FORMAT, (uintx)reasonable_minimum); |
1817 "and will likely be removed in a future release"); | 1833 "and will likely be removed in a future release"); |
1818 } | 1834 } |
1819 | 1835 |
1820 if (CMSIncrementalMode) { | 1836 if (CMSIncrementalMode) { |
1821 warning("Using incremental CMS is deprecated and will likely be removed in a future release"); | 1837 warning("Using incremental CMS is deprecated and will likely be removed in a future release"); |
1838 } | |
1839 } | |
1840 | |
1841 void Arguments::check_deprecated_gc_flags() { | |
1842 if (FLAG_IS_CMDLINE(MaxGCMinorPauseMillis)) { | |
1843 warning("Using MaxGCMinorPauseMillis as minor pause goal is deprecated" | |
1844 "and will likely be removed in future release"); | |
1822 } | 1845 } |
1823 } | 1846 } |
1824 | 1847 |
1825 // Check stack pages settings | 1848 // Check stack pages settings |
1826 bool Arguments::check_stack_pages() | 1849 bool Arguments::check_stack_pages() |
2326 size_t len2 = strlen(pos+1) + 1; // options start after ':'. Final zero must be copied. | 2349 size_t len2 = strlen(pos+1) + 1; // options start after ':'. Final zero must be copied. |
2327 options = (char*)memcpy(NEW_C_HEAP_ARRAY(char, len2, mtInternal), pos+1, len2); | 2350 options = (char*)memcpy(NEW_C_HEAP_ARRAY(char, len2, mtInternal), pos+1, len2); |
2328 } | 2351 } |
2329 #if !INCLUDE_JVMTI | 2352 #if !INCLUDE_JVMTI |
2330 if ((strcmp(name, "hprof") == 0) || (strcmp(name, "jdwp") == 0)) { | 2353 if ((strcmp(name, "hprof") == 0) || (strcmp(name, "jdwp") == 0)) { |
2331 warning("profiling and debugging agents are not supported in this VM"); | 2354 jio_fprintf(defaultStream::error_stream(), |
2332 } else | 2355 "Profiling and debugging agents are not supported in this VM\n"); |
2356 return JNI_ERR; | |
2357 } | |
2333 #endif // !INCLUDE_JVMTI | 2358 #endif // !INCLUDE_JVMTI |
2334 add_init_library(name, options); | 2359 add_init_library(name, options); |
2335 } | 2360 } |
2336 // -agentlib and -agentpath | 2361 // -agentlib and -agentpath |
2337 } else if (match_option(option, "-agentlib:", &tail) || | 2362 } else if (match_option(option, "-agentlib:", &tail) || |
2338 (is_absolute_path = match_option(option, "-agentpath:", &tail))) { | 2363 (is_absolute_path = match_option(option, "-agentpath:", &tail))) { |
2339 if(tail != NULL) { | 2364 if(tail != NULL) { |
2346 if(pos != NULL) { | 2371 if(pos != NULL) { |
2347 options = strcpy(NEW_C_HEAP_ARRAY(char, strlen(pos + 1) + 1, mtInternal), pos + 1); | 2372 options = strcpy(NEW_C_HEAP_ARRAY(char, strlen(pos + 1) + 1, mtInternal), pos + 1); |
2348 } | 2373 } |
2349 #if !INCLUDE_JVMTI | 2374 #if !INCLUDE_JVMTI |
2350 if ((strcmp(name, "hprof") == 0) || (strcmp(name, "jdwp") == 0)) { | 2375 if ((strcmp(name, "hprof") == 0) || (strcmp(name, "jdwp") == 0)) { |
2351 warning("profiling and debugging agents are not supported in this VM"); | 2376 jio_fprintf(defaultStream::error_stream(), |
2352 } else | 2377 "Profiling and debugging agents are not supported in this VM\n"); |
2378 return JNI_ERR; | |
2379 } | |
2353 #endif // !INCLUDE_JVMTI | 2380 #endif // !INCLUDE_JVMTI |
2354 add_init_agent(name, options, is_absolute_path); | 2381 add_init_agent(name, options, is_absolute_path); |
2355 | |
2356 } | 2382 } |
2357 // -javaagent | 2383 // -javaagent |
2358 } else if (match_option(option, "-javaagent:", &tail)) { | 2384 } else if (match_option(option, "-javaagent:", &tail)) { |
2359 #if !INCLUDE_JVMTI | 2385 #if !INCLUDE_JVMTI |
2360 warning("Instrumentation agents are not supported in this VM"); | 2386 jio_fprintf(defaultStream::error_stream(), |
2387 "Instrumentation agents are not supported in this VM\n"); | |
2388 return JNI_ERR; | |
2361 #else | 2389 #else |
2362 if(tail != NULL) { | 2390 if(tail != NULL) { |
2363 char *options = strcpy(NEW_C_HEAP_ARRAY(char, strlen(tail) + 1, mtInternal), tail); | 2391 char *options = strcpy(NEW_C_HEAP_ARRAY(char, strlen(tail) + 1, mtInternal), tail); |
2364 add_init_agent("instrument", options, false); | 2392 add_init_agent("instrument", options, false); |
2365 } | 2393 } |
2496 // -Xprof | 2524 // -Xprof |
2497 } else if (match_option(option, "-Xprof", &tail)) { | 2525 } else if (match_option(option, "-Xprof", &tail)) { |
2498 #if INCLUDE_FPROF | 2526 #if INCLUDE_FPROF |
2499 _has_profile = true; | 2527 _has_profile = true; |
2500 #else // INCLUDE_FPROF | 2528 #else // INCLUDE_FPROF |
2501 // do we have to exit? | 2529 jio_fprintf(defaultStream::error_stream(), |
2502 warning("Flat profiling is not supported in this VM."); | 2530 "Flat profiling is not supported in this VM.\n"); |
2531 return JNI_ERR; | |
2503 #endif // INCLUDE_FPROF | 2532 #endif // INCLUDE_FPROF |
2504 // -Xaprof | 2533 // -Xaprof |
2505 } else if (match_option(option, "-Xaprof", &tail)) { | 2534 } else if (match_option(option, "-Xaprof", &tail)) { |
2506 _has_alloc_profile = true; | 2535 _has_alloc_profile = true; |
2507 // -Xconcurrentio | 2536 // -Xconcurrentio |
2531 // Out of the box management support | 2560 // Out of the box management support |
2532 if (match_option(option, "-Dcom.sun.management", &tail)) { | 2561 if (match_option(option, "-Dcom.sun.management", &tail)) { |
2533 #if INCLUDE_MANAGEMENT | 2562 #if INCLUDE_MANAGEMENT |
2534 FLAG_SET_CMDLINE(bool, ManagementServer, true); | 2563 FLAG_SET_CMDLINE(bool, ManagementServer, true); |
2535 #else | 2564 #else |
2536 vm_exit_during_initialization( | 2565 jio_fprintf(defaultStream::output_stream(), |
2537 "-Dcom.sun.management is not supported in this VM.", NULL); | 2566 "-Dcom.sun.management is not supported in this VM.\n"); |
2567 return JNI_ERR; | |
2538 #endif | 2568 #endif |
2539 } | 2569 } |
2540 // -Xint | 2570 // -Xint |
2541 } else if (match_option(option, "-Xint", &tail)) { | 2571 } else if (match_option(option, "-Xint", &tail)) { |
2542 set_mode_flags(_int); | 2572 set_mode_flags(_int); |
2545 set_mode_flags(_mixed); | 2575 set_mode_flags(_mixed); |
2546 // -Xcomp | 2576 // -Xcomp |
2547 } else if (match_option(option, "-Xcomp", &tail)) { | 2577 } else if (match_option(option, "-Xcomp", &tail)) { |
2548 // for testing the compiler; turn off all flags that inhibit compilation | 2578 // for testing the compiler; turn off all flags that inhibit compilation |
2549 set_mode_flags(_comp); | 2579 set_mode_flags(_comp); |
2550 | |
2551 // -Xshare:dump | 2580 // -Xshare:dump |
2552 } else if (match_option(option, "-Xshare:dump", &tail)) { | 2581 } else if (match_option(option, "-Xshare:dump", &tail)) { |
2553 #if !INCLUDE_CDS | |
2554 vm_exit_during_initialization( | |
2555 "Dumping a shared archive is not supported in this VM.", NULL); | |
2556 #else | |
2557 FLAG_SET_CMDLINE(bool, DumpSharedSpaces, true); | 2582 FLAG_SET_CMDLINE(bool, DumpSharedSpaces, true); |
2558 set_mode_flags(_int); // Prevent compilation, which creates objects | 2583 set_mode_flags(_int); // Prevent compilation, which creates objects |
2559 #endif | |
2560 // -Xshare:on | 2584 // -Xshare:on |
2561 } else if (match_option(option, "-Xshare:on", &tail)) { | 2585 } else if (match_option(option, "-Xshare:on", &tail)) { |
2562 FLAG_SET_CMDLINE(bool, UseSharedSpaces, true); | 2586 FLAG_SET_CMDLINE(bool, UseSharedSpaces, true); |
2563 FLAG_SET_CMDLINE(bool, RequireSharedSpaces, true); | 2587 FLAG_SET_CMDLINE(bool, RequireSharedSpaces, true); |
2564 // -Xshare:auto | 2588 // -Xshare:auto |
2567 FLAG_SET_CMDLINE(bool, RequireSharedSpaces, false); | 2591 FLAG_SET_CMDLINE(bool, RequireSharedSpaces, false); |
2568 // -Xshare:off | 2592 // -Xshare:off |
2569 } else if (match_option(option, "-Xshare:off", &tail)) { | 2593 } else if (match_option(option, "-Xshare:off", &tail)) { |
2570 FLAG_SET_CMDLINE(bool, UseSharedSpaces, false); | 2594 FLAG_SET_CMDLINE(bool, UseSharedSpaces, false); |
2571 FLAG_SET_CMDLINE(bool, RequireSharedSpaces, false); | 2595 FLAG_SET_CMDLINE(bool, RequireSharedSpaces, false); |
2572 | |
2573 // -Xverify | 2596 // -Xverify |
2574 } else if (match_option(option, "-Xverify", &tail)) { | 2597 } else if (match_option(option, "-Xverify", &tail)) { |
2575 if (strcmp(tail, ":all") == 0 || strcmp(tail, "") == 0) { | 2598 if (strcmp(tail, ":all") == 0 || strcmp(tail, "") == 0) { |
2576 FLAG_SET_CMDLINE(bool, BytecodeVerificationLocal, true); | 2599 FLAG_SET_CMDLINE(bool, BytecodeVerificationLocal, true); |
2577 FLAG_SET_CMDLINE(bool, BytecodeVerificationRemote, true); | 2600 FLAG_SET_CMDLINE(bool, BytecodeVerificationRemote, true); |
2648 // is turned on below, the actual space used may be smaller. | 2671 // is turned on below, the actual space used may be smaller. |
2649 | 2672 |
2650 initHeapSize = MIN2(total_memory / (julong)2, | 2673 initHeapSize = MIN2(total_memory / (julong)2, |
2651 total_memory - (julong)160*M); | 2674 total_memory - (julong)160*M); |
2652 | 2675 |
2653 // Make sure that if we have a lot of memory we cap the 32 bit | 2676 initHeapSize = limit_by_allocatable_memory(initHeapSize); |
2654 // process space. The 64bit VM version of this function is a nop. | |
2655 initHeapSize = os::allocatable_physical_memory(initHeapSize); | |
2656 | 2677 |
2657 if (FLAG_IS_DEFAULT(MaxHeapSize)) { | 2678 if (FLAG_IS_DEFAULT(MaxHeapSize)) { |
2658 FLAG_SET_CMDLINE(uintx, MaxHeapSize, initHeapSize); | 2679 FLAG_SET_CMDLINE(uintx, MaxHeapSize, initHeapSize); |
2659 FLAG_SET_CMDLINE(uintx, InitialHeapSize, initHeapSize); | 2680 FLAG_SET_CMDLINE(uintx, InitialHeapSize, initHeapSize); |
2660 // Currently the minimum size and the initial heap sizes are the same. | 2681 // Currently the minimum size and the initial heap sizes are the same. |
2881 // away and will cause VM initialization failures! | 2902 // away and will cause VM initialization failures! |
2882 warning("-XX:+UseVMInterruptibleIO is obsolete and will be removed in a future release."); | 2903 warning("-XX:+UseVMInterruptibleIO is obsolete and will be removed in a future release."); |
2883 FLAG_SET_CMDLINE(bool, UseVMInterruptibleIO, true); | 2904 FLAG_SET_CMDLINE(bool, UseVMInterruptibleIO, true); |
2884 #if !INCLUDE_MANAGEMENT | 2905 #if !INCLUDE_MANAGEMENT |
2885 } else if (match_option(option, "-XX:+ManagementServer", &tail)) { | 2906 } else if (match_option(option, "-XX:+ManagementServer", &tail)) { |
2886 vm_exit_during_initialization( | 2907 jio_fprintf(defaultStream::error_stream(), |
2887 "ManagementServer is not supported in this VM.", NULL); | 2908 "ManagementServer is not supported in this VM.\n"); |
2909 return JNI_ERR; | |
2888 #endif // INCLUDE_MANAGEMENT | 2910 #endif // INCLUDE_MANAGEMENT |
2889 } else if (match_option(option, "-XX:", &tail)) { // -XX:xxxx | 2911 } else if (match_option(option, "-XX:", &tail)) { // -XX:xxxx |
2890 // Skip -XX:Flags= since that case has already been handled | 2912 // Skip -XX:Flags= since that case has already been handled |
2891 if (strncmp(tail, "Flags=", strlen("Flags=")) != 0) { | 2913 if (strncmp(tail, "Flags=", strlen("Flags=")) != 0) { |
2892 if (!process_argument(tail, args->ignoreUnrecognized, origin)) { | 2914 if (!process_argument(tail, args->ignoreUnrecognized, origin)) { |
3199 } | 3221 } |
3200 if (match_option(option, "-XX:NativeMemoryTracking", &tail)) { | 3222 if (match_option(option, "-XX:NativeMemoryTracking", &tail)) { |
3201 #if INCLUDE_NMT | 3223 #if INCLUDE_NMT |
3202 MemTracker::init_tracking_options(tail); | 3224 MemTracker::init_tracking_options(tail); |
3203 #else | 3225 #else |
3204 warning("Native Memory Tracking is not supported in this VM"); | 3226 jio_fprintf(defaultStream::error_stream(), |
3227 "Native Memory Tracking is not supported in this VM\n"); | |
3228 return JNI_ERR; | |
3205 #endif | 3229 #endif |
3206 } | 3230 } |
3207 | 3231 |
3208 | 3232 |
3209 #ifndef PRODUCT | 3233 #ifndef PRODUCT |
3318 | 3342 |
3319 #if !INCLUDE_ALL_GCS | 3343 #if !INCLUDE_ALL_GCS |
3320 force_serial_gc(); | 3344 force_serial_gc(); |
3321 #endif // INCLUDE_ALL_GCS | 3345 #endif // INCLUDE_ALL_GCS |
3322 #if !INCLUDE_CDS | 3346 #if !INCLUDE_CDS |
3347 if (DumpSharedSpaces || RequireSharedSpaces) { | |
3348 jio_fprintf(defaultStream::error_stream(), | |
3349 "Shared spaces are not supported in this VM\n"); | |
3350 return JNI_ERR; | |
3351 } | |
3352 if ((UseSharedSpaces && FLAG_IS_CMDLINE(UseSharedSpaces)) || PrintSharedSpaces) { | |
3353 warning("Shared spaces are not supported in this VM"); | |
3354 FLAG_SET_DEFAULT(UseSharedSpaces, false); | |
3355 FLAG_SET_DEFAULT(PrintSharedSpaces, false); | |
3356 } | |
3323 no_shared_spaces(); | 3357 no_shared_spaces(); |
3324 #endif // INCLUDE_CDS | 3358 #endif // INCLUDE_CDS |
3325 | 3359 |
3326 // Set flags based on ergonomics. | 3360 // Set flags based on ergonomics. |
3327 set_ergonomics_flags(); | 3361 set_ergonomics_flags(); |
3356 set_parnew_gc_flags(); | 3390 set_parnew_gc_flags(); |
3357 } else if (UseG1GC) { | 3391 } else if (UseG1GC) { |
3358 set_g1_gc_flags(); | 3392 set_g1_gc_flags(); |
3359 } | 3393 } |
3360 check_deprecated_gcs(); | 3394 check_deprecated_gcs(); |
3395 check_deprecated_gc_flags(); | |
3396 if (AssumeMP && !UseSerialGC) { | |
3397 if (FLAG_IS_DEFAULT(ParallelGCThreads) && ParallelGCThreads == 1) { | |
3398 warning("If the number of processors is expected to increase from one, then" | |
3399 " you should configure the number of parallel GC threads appropriately" | |
3400 " using -XX:ParallelGCThreads=N"); | |
3401 } | |
3402 } | |
3361 #else // INCLUDE_ALL_GCS | 3403 #else // INCLUDE_ALL_GCS |
3362 assert(verify_serial_gc_flags(), "SerialGC unset"); | 3404 assert(verify_serial_gc_flags(), "SerialGC unset"); |
3363 #endif // INCLUDE_ALL_GCS | 3405 #endif // INCLUDE_ALL_GCS |
3364 | 3406 |
3365 // Set bytecode rewriting flags | 3407 // Set bytecode rewriting flags |