RFR: 8222252 - Java ergonomics limits heap to 128GB with disabled compressed oops

David Holmes david.holmes at oracle.com
Tue May 14 10:10:45 UTC 2019


Hi Bob,

On 14/05/2019 12:03 am, Bob Vandette wrote:
> Please review this suggested fix for correcting Heap size selection when
> -XX:{Max,Min,Initial)RAMPercentage and their Factional equivalent options
> are used.
> 
> There are two bugs filed that are related to this issue (8222252 and 8213175)
> 
> SUMMARY of FIX:
> The fix corrects what I believe is an incorrect implementation of the *Percentage/*Fraction
> options.  These options should not have caused the heap size to be fractionally based on MaxRAM
> or limited by MaxRAM.  They instead should be based on the host memory. This is what I assume
> was meant by “real memory”.
> 
>   product(double, MaxRAMPercentage, 25.0,                                   \
>           "Maximum percentage of real memory used for maximum heap size") \
>           range(0.0, 100.0)

Perhaps - but if I'm reading things correctly this change will now 
potentially result in a different amount of memory being used if 
physical memory > MaxRAM default - right? In which case this is a 
behavioural change that will require a CSR request.

Further, I think if someone sets MaxRAM and one of the "fraction" flags 
then they may well want the fraction to apply to the MaxRAM value they 
gave - so I think you're use of physical_memory() should also require 
FLAG_IS_DEFAULT(MaxRAM).

Cheers,
David
-----

> When these options are selected, they should take precedence over UseCompressedOops
> unless UseCompressedOops is also specified on the command line.
> 
> 
> WEBREV:
> http://cr.openjdk.java.net/~bobv/8222252/webrev.01
> 
> BUGS:
> https://bugs.openjdk.java.net/browse/JDK-8222252
> Java ergonomics limits heap to 128GB with disabled compressed oops
> 
> https://bugs.openjdk.java.net/browse/JDK-8213175
> Java ergonomics limits heap to 32GB to allow compressed oops
> 
> 
> RESULTS TABLE:
> 
> On a System with 148G of RAM
> 
> ./java -XX:MaxRAM=192g -XX:+PrintFlagsFinal -version | grep MaxHeapSize
>     size_t MaxHeapSize                              = 32178700288                               {product} {ergonomic}
> ./java -XX:MaxRAM=192g -XX:+PrintFlagsFinal -version | grep UseCompressedOops
>       bool UseCompressedOops                        = true                                 {lp64_product} {ergonomic}
> 
> ./java -XX:MaxRAM=192g -XX:MaxRAMPercentage=75 -XX:+PrintFlagsFinal -version | grep MaxHeapSize
>     size_t MaxHeapSize       [ORIG]                 = 32178700288                               {product} {ergonomic}
>     size_t MaxHeapSize       [NEW]                  = 113883742208                              {product} {ergonomic}
> ./java -XX:MaxRAM=192g -XX:MaxRAMPercentage=75 -XX:+PrintFlagsFinal -version | grep UseCompressedOops
>       bool UseCompressedOops [ORIG]                 = true                                 {lp64_product} {ergonomic}
>       bool UseCompressedOops [NEW]                  = false                                {lp64_product} {ergonomic}
> 
> ./java -XX:MaxRAMPercentage=10 -XX:+PrintFlagsFinal -version | grep MaxHeapSize
>     size_t MaxHeapSize       [ORIG]                 = 13744734208                               {product} {ergonomic}
>     size_t MaxHeapSize       [NEW]                  = 15183380480                               {product} {ergonomic}
> ./java -XX:MaxRAMPercentage=10 -XX:+PrintFlagsFinal -version | grep UseCompressedOops
>       bool UseCompressedOops                        = true                                 {lp64_product} {ergonomic}
> 
> ./java -XX:+PrintFlagsFinal -version | grep MaxHeapSize
>     size_t MaxHeapSize                              = 32178700288                               {product} {ergonomic}
> ./java -XX:+PrintFlagsFinal -version | grep UseCompressedOops
>       bool UseCompressedOops                        = true                                 {lp64_product} {ergonomic}
> 
> ./java -XX:-UseCompressedOops -XX:+PrintFlagsFinal -version | grep MaxHeapSize
>     size_t MaxHeapSize                              = 34359738368                               {product} {ergonomic}
> ./java -XX:-UseCompressedOops -XX:+PrintFlagsFinal -version | grep UseCompressedOops
>       bool UseCompressedOops                        = false                                {lp64_product} {command line}
> 
> ./java -XX:+UseCompressedOops -XX:MaxRAM=128g -XX:+PrintFlagsFinal -version | grep MaxHeapSize
>     size_t MaxHeapSize                              = 32178700288                               {product} {ergonomic}
> ./java -XX:+UseCompressedOops -XX:MaxRAM=128g -XX:+PrintFlagsFinal -version | grep UseCompressedOops
>       bool UseCompressedOops                        = true                                 {lp64_product} {command line}
> 
> ./java -XX:+UseCompressedOops -XX:MaxRAMPercentage=75 -XX:+PrintFlagsFinal -version | grep MaxHeapSize
>     size_t MaxHeapSize                              = 32178700288                               {product} {ergonomic}
> ./java -XX:+UseCompressedOops -XX:MaxRAMPercentage=75 -XX:+PrintFlagsFinal -version | grep UseCompressedOops
>       bool UseCompressedOops                        = true                                 {lp64_product} {command line}
> 
> 
> 
> Bob.
> 



More information about the hotspot-gc-dev mailing list