@@ -536,7 +536,6 @@ static SpecialFlag const special_jvm_flags[] = {
536536#ifdef _LP64
537537 { " UseCompressedClassPointers" , JDK_Version::jdk (25 ), JDK_Version::jdk (27 ), JDK_Version::undefined () },
538538#endif
539- { " AggressiveHeap" , JDK_Version::jdk (26 ), JDK_Version::jdk (27 ), JDK_Version::jdk (28 ) },
540539 // --- Deprecated alias flags (see also aliased_jvm_flags) - sorted by obsolete_in then expired_in:
541540 { " CreateMinidumpOnCrash" , JDK_Version::jdk (9 ), JDK_Version::undefined (), JDK_Version::undefined () },
542541
@@ -556,6 +555,7 @@ static SpecialFlag const special_jvm_flags[] = {
556555 { " AlwaysActAsServerClassMachine" , JDK_Version::jdk (26 ), JDK_Version::jdk (27 ), JDK_Version::jdk (28 ) },
557556 { " UseXMMForArrayCopy" , JDK_Version::undefined (), JDK_Version::jdk (27 ), JDK_Version::jdk (28 ) },
558557 { " UseNewLongLShift" , JDK_Version::undefined (), JDK_Version::jdk (27 ), JDK_Version::jdk (28 ) },
558+ { " AggressiveHeap" , JDK_Version::jdk (26 ), JDK_Version::jdk (27 ), JDK_Version::jdk (28 ) },
559559
560560#ifdef ASSERT
561561 { " DummyObsoleteTestFlag" , JDK_Version::undefined (), JDK_Version::jdk (18 ), JDK_Version::undefined () },
@@ -1490,13 +1490,7 @@ jint Arguments::set_ergonomics_flags() {
14901490}
14911491
14921492size_t Arguments::limit_heap_by_allocatable_memory (size_t limit) {
1493- // The AggressiveHeap check is a temporary workaround to avoid calling
1494- // GCarguments::heap_virtual_to_physical_ratio() before a GC has been
1495- // selected. This works because AggressiveHeap implies UseParallelGC
1496- // where we know the ratio will be 1. Once the AggressiveHeap option is
1497- // removed, this can be cleaned up.
1498- size_t heap_virtual_to_physical_ratio = (AggressiveHeap ? 1 : GCConfig::arguments ()->heap_virtual_to_physical_ratio ());
1499- size_t fraction = MaxVirtMemFraction * heap_virtual_to_physical_ratio;
1493+ size_t fraction = MaxVirtMemFraction * GCConfig::arguments ()->heap_virtual_to_physical_ratio ();
15001494 size_t max_allocatable = os::commit_memory_limit ();
15011495
15021496 return MIN2 (limit, max_allocatable / fraction);
@@ -1627,107 +1621,6 @@ void Arguments::set_heap_size() {
16271621 }
16281622}
16291623
1630- // This option inspects the machine and attempts to set various
1631- // parameters to be optimal for long-running, memory allocation
1632- // intensive jobs. It is intended for machines with large
1633- // amounts of cpu and memory.
1634- jint Arguments::set_aggressive_heap_flags () {
1635- // initHeapSize is needed since _initial_heap_size is 4 bytes on a 32 bit
1636- // VM, but we may not be able to represent the total physical memory
1637- // available (like having 8gb of memory on a box but using a 32bit VM).
1638- // Thus, we need to make sure we're using a julong for intermediate
1639- // calculations.
1640- julong initHeapSize;
1641- physical_memory_size_type phys_mem = os::physical_memory ();
1642- julong total_memory = static_cast <julong>(phys_mem);
1643-
1644- if (total_memory < (julong) 256 * M) {
1645- jio_fprintf (defaultStream::error_stream (),
1646- " You need at least 256mb of memory to use -XX:+AggressiveHeap\n " );
1647- vm_exit (1 );
1648- }
1649-
1650- // The heap size is half of available memory, or (at most)
1651- // all of possible memory less 160mb (leaving room for the OS
1652- // when using ISM). This is the maximum; because adaptive sizing
1653- // is turned on below, the actual space used may be smaller.
1654-
1655- initHeapSize = MIN2 (total_memory / (julong) 2 ,
1656- total_memory - (julong) 160 * M);
1657-
1658- initHeapSize = limit_heap_by_allocatable_memory (initHeapSize);
1659-
1660- if (FLAG_IS_DEFAULT (MaxHeapSize)) {
1661- if (FLAG_SET_CMDLINE (MaxHeapSize, initHeapSize) != JVMFlag::SUCCESS) {
1662- return JNI_EINVAL;
1663- }
1664- if (FLAG_SET_CMDLINE (InitialHeapSize, initHeapSize) != JVMFlag::SUCCESS) {
1665- return JNI_EINVAL;
1666- }
1667- if (FLAG_SET_CMDLINE (MinHeapSize, initHeapSize) != JVMFlag::SUCCESS) {
1668- return JNI_EINVAL;
1669- }
1670- }
1671- if (FLAG_IS_DEFAULT (NewSize)) {
1672- // Make the young generation 3/8ths of the total heap.
1673- if (FLAG_SET_CMDLINE (NewSize,
1674- ((julong) MaxHeapSize / (julong) 8 ) * (julong) 3 ) != JVMFlag::SUCCESS) {
1675- return JNI_EINVAL;
1676- }
1677- if (FLAG_SET_CMDLINE (MaxNewSize, NewSize) != JVMFlag::SUCCESS) {
1678- return JNI_EINVAL;
1679- }
1680- }
1681-
1682- #if !defined(_ALLBSD_SOURCE) && !defined(AIX) // UseLargePages is not yet supported on BSD and AIX.
1683- FLAG_SET_DEFAULT (UseLargePages, true );
1684- #endif
1685-
1686- // Increase some data structure sizes for efficiency
1687- if (FLAG_SET_CMDLINE (ResizeTLAB, false ) != JVMFlag::SUCCESS) {
1688- return JNI_EINVAL;
1689- }
1690- if (FLAG_SET_CMDLINE (TLABSize, 256 * K) != JVMFlag::SUCCESS) {
1691- return JNI_EINVAL;
1692- }
1693-
1694- // See the OldPLABSize comment below, but replace 'after promotion'
1695- // with 'after copying'. YoungPLABSize is the size of the survivor
1696- // space per-gc-thread buffers. The default is 4kw.
1697- if (FLAG_SET_CMDLINE (YoungPLABSize, 256 * K) != JVMFlag::SUCCESS) { // Note: this is in words
1698- return JNI_EINVAL;
1699- }
1700-
1701- // OldPLABSize is the size of the buffers in the old gen that
1702- // UseParallelGC uses to promote live data that doesn't fit in the
1703- // survivor spaces. At any given time, there's one for each gc thread.
1704- // The default size is 1kw. These buffers are rarely used, since the
1705- // survivor spaces are usually big enough. For specjbb, however, there
1706- // are occasions when there's lots of live data in the young gen
1707- // and we end up promoting some of it. We don't have a definite
1708- // explanation for why bumping OldPLABSize helps, but the theory
1709- // is that a bigger PLAB results in retaining something like the
1710- // original allocation order after promotion, which improves mutator
1711- // locality. A minor effect may be that larger PLABs reduce the
1712- // number of PLAB allocation events during gc. The value of 8kw
1713- // was arrived at by experimenting with specjbb.
1714- if (FLAG_SET_CMDLINE (OldPLABSize, 8 * K) != JVMFlag::SUCCESS) { // Note: this is in words
1715- return JNI_EINVAL;
1716- }
1717-
1718- // Enable parallel GC and adaptive generation sizing
1719- if (FLAG_SET_CMDLINE (UseParallelGC, true ) != JVMFlag::SUCCESS) {
1720- return JNI_EINVAL;
1721- }
1722-
1723- // Encourage steady state memory management
1724- if (FLAG_SET_CMDLINE (ThresholdTolerance, 100 ) != JVMFlag::SUCCESS) {
1725- return JNI_EINVAL;
1726- }
1727-
1728- return JNI_OK;
1729- }
1730-
17311624// This must be called after ergonomics.
17321625void Arguments::set_bytecode_flags () {
17331626 if (!RewriteBytecodes) {
@@ -2938,16 +2831,6 @@ jint Arguments::finalize_vm_init_args() {
29382831 return JNI_ERR;
29392832 }
29402833
2941- // This must be done after all arguments have been processed
2942- // and the container support has been initialized since AggressiveHeap
2943- // relies on the amount of total memory available.
2944- if (AggressiveHeap) {
2945- jint result = set_aggressive_heap_flags ();
2946- if (result != JNI_OK) {
2947- return result;
2948- }
2949- }
2950-
29512834 // CompileThresholdScaling == 0.0 is same as -Xint: Disable compilation (enable interpreter-only mode),
29522835 // but like -Xint, leave compilation thresholds unaffected.
29532836 // With tiered compilation disabled, setting CompileThreshold to 0 disables compilation as well.
0 commit comments