JDK-8280016 : gc/g1/TestShrinkAuxiliaryData30 test fails on large machines
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 8,11,17,18,19
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2022-01-14
  • Updated: 2022-11-22
  • Resolved: 2022-01-17
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 17 JDK 19
17.0.6Fixed 19 b06Fixed
Related Reports
Relates :  
Description
It is the bug in original implementation of JDK-8043766.

The test tries to run with -XX:G1ConcRSLogCacheSize=30, while the max acceptable value is 27:

  product(size_t, G1ConcRSLogCacheSize, 10,                                 \
          "Log base 2 of the length of conc RS hot-card cache.")            \
          range(0, 27)                                                      \

It only happens on large machines, because smaller machines get the test skipped with:

        int maxCacheSize = Math.max(0, Math.min(31, getMaxCacheSize()));
        if (maxCacheSize < hotCardTableSize) {
            throw new SkippedException(String.format(
                    "Skiping test for %d cache size due max cache size %d",
                    hotCardTableSize, maxCacheSize));
        }

getMaxCacheSize() is derived from the Runtime.getRuntime().freeMemory():

    private static int getMaxCacheSize() {
        long availableMemory = Runtime.getRuntime().freeMemory()
                - ShrinkAuxiliaryDataTest.getMemoryUsedByTest() - 1l;
        if (availableMemory <= 0) {
            return 0;
        }

        long availablePointersCount = availableMemory / Unsafe.ADDRESS_SIZE;
        return (63 - (int) Long.numberOfLeadingZeros(availablePointersCount));
    }

So, on smaller machines, for example, my 128G desktop:

jtreg.SkippedException: Skiping test for 30 cache size due max cache size 26
	at gc.g1.TestShrinkAuxiliaryData.test(TestShrinkAuxiliaryData.java:77)

On my 1T server, this test is not skipped and reliably fails like:

 stdout: [];
 stderr: [size_t G1ConcRSLogCacheSize=30 is outside the allowed range [ 0 ... 27 ]
Improperly specified VM option 'G1ConcRSLogCacheSize=30'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
]
 exitValue = 1
Comments
Fix Request (17u) Fixes a test bug. Applies cleanly.
21-11-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk17u-dev/pull/908 Date: 2022-11-21 12:39:00 +0000
21-11-2022

Changeset: 590eb860 Author: Aleksey Shipilev <shade@openjdk.org> Date: 2022-01-17 08:17:49 +0000 URL: https://git.openjdk.java.net/jdk/commit/590eb86033d5445018cd0e961e8721a20de4bb0c
17-01-2022

A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk/pull/7082 Date: 2022-01-14 13:24:58 +0000
14-01-2022