RFR: 8224764 - Create jtreg test for JDK-8222252

Bob Vandette bob.vandette at oracle.com
Tue Jun 25 14:48:47 UTC 2019

See responses below …

> On Jun 25, 2019, at 8:33 AM, Thomas Schatzl <thomas.schatzl at oracle.com> wrote:
> Hi,
> On Mon, 2019-06-24 at 13:19 -0400, Bob Vandette wrote:
>> Ping …
>  sorry, I overlooked that one...
>>> On Jun 18, 2019, at 8:28 AM, Bob Vandette <bob.vandette at oracle.com>
>>> wrote:
>>> Please review this new test that verifies the updated behavior for
>>> -XX:MaxRAMPercentage and -XX:MaxRAM
>>> as documented in these two bugs:
>>> https://bugs.openjdk.java.net/browse/JDK-8213175 - Java ergonomics
>>> limits heap to 32GB to allow compressed oops
>>> https://bugs.openjdk.java.net/browse/JDK-8222252 - Java ergonomics
>>> limits heap to 128GB with disabled compressed oops
>>> BUG:
>>> https://bugs.openjdk.java.net/browse/JDK-8224764
>>> http://cr.openjdk.java.net/~bobv/8224764/webrev.00
>>> The test attempts to set MaxRAM 1G below and above the Maximum Heap
>>> size allowed by CompressedOops and verifies that compressed oops is
>>> disabled when the requested heap size is above the limit.  It also
>>> verifies that if UseCompressedOops is specified, it will limit the
>>> heap size.
> - I would exclude the test for non-64 bit VMs in the header instead at
> runtime. This saves unnecessary executions.

Ok, done.

> I.e. add a "@requires vm.bits == "64" in the header and remove the
> corresponding code in the main method.
> - line 71 seems to be some debug code to remove

Yes, removed.

> - line 125 seems to be some additional code that fixes(?) some issue
> you had determining the max heap for compressed oops. If so, I would
> prefer to put that in
> TestUseCompressedOopsErgoTools.getMaxHeapForCompressedOops.

This fix is only necessary for my specific test and not in all other uses.

TestUseCompressedOopsErgo verifies the UseCompressedOops flag resulting
from different garbage collectors and different -Xmx settings.  My test requires
a reduction of the Max COOP Heap size based on this logic in arguments.cpp:1806.
This logic only applies if -Xmx was not specified.  My test does not use -Xmx.

      if (HeapBaseMinAddress + MaxHeapSize < max_coop_heap) {
        // Heap should be above HeapBaseMinAddress to get zero based compressed oops
        // but it should be not less than default MaxHeapSize.
        max_coop_heap -= HeapBaseMinAddress;

Since I'm using the default MaxHeapSize and HeapBaseMinAddress, the condition above is always true.
This is why I need to add this logic to my test.


> Thanks,
>  Thomas

More information about the hotspot-gc-dev mailing list