Summary
The AggressiveHeap flag, while intended to simplify JVM tuning for memory-intensive applications, introduces ambiguity and maintenance challenges, making it unsuitable as a general-purpose optimization option. The flag should be deprecated for removal in JDK 26, obsoleted in JDK 27, and removed in JDK 28.
Problem
The -XX:+AggressiveHeap flag is an alias that enables a set of heap tuning options, intended to optimize performance for long-running, memory-intensive applications. Despite documentation suggesting its general applicability, a closer review of the implementation and associated comments reveals a strong focus on SPECjbb-specific benchmarking scenarios. This focus creates ambiguity about its suitability as a general optimization for all long-running, memory-intensive workloads. The heap tuning options enabled by AggressiveHeap have changed little since their introduction, either because they still suit certain benchmarks or simply due to lack of ongoing maintenance. As JVM tuning practices and documentation have evolved, users can now explicitly set memory and heap options tailored to their specific workloads. Consequently, the continued existence of AggressiveHeap appears unnecessary, especially since its behavior lacks transparency, may not apply broadly, and can result in inconsistent performance due to changes across JVM versions. Deprecating AggressiveHeap will reduce maintenance overhead and remove unintuitive assumptions in the JVM, such as always implying use of ParallelGC. Ultimately, this change encourages users to make explicit and well-informed configuration choices, improving both usability and predictability.
The primary impact of removing the AggressiveHeap flag is that users will need to manually configure the relevant flags. Notably, -XX:+AggressiveHeap sets the Java heap size to half of the available system memory. Deprecating the flag means users will now need to manually determine and assign appropriate values for their environment.
Solution
AggressiveHeap is deprecated for removal in JDK 26, obsoleted in JDK 27, and removed in JDK 28.
Users of the AggressiveHeap flag should instead manually specify the corresponding flags:
-XX:+UseParallelGC -XX:+UseLargePages -XX:-ResizeTLAB -XX:TLABSize=256K -XX:YoungPLABSize=256K -XX:OldPLABSize=8K -XX:ThresholdTolerance=100
and set the following values: -Xmx and -Xms to half the available physical memory, -XX:NewSize to 3/8 of available physical memory, and -XX:MaxNewSize to the value of NewSize.
Specification
product(bool, AggressiveHeap, false,                                      \
        "(Deprecated) Optimize heap options for long-running memory "     \
        "intensive apps")                                                 \
- csr of
 - 
                    
JDK-8370813 Deprecate AggressiveHeap
-         
     - Open
 
 -