JDK-8079378 : java/util/Arrays/TimSortStackSize2.java fails in jdk_util with -UseCompressedOops
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util
  • Affected Version: 9
  • Priority: P3
  • Status: Resolved
  • Resolution: Cannot Reproduce
  • Submitted: 2015-05-05
  • Updated: 2017-11-15
  • Resolved: 2016-03-02
Related Reports
Relates :  
Relates :  
$ export JAVA_ARGS="-XX:-UseCompressedOops"
$ make jdk_util
compressedOops: false; Test will be started with "-Xms770m"
Command line: [/export/twisti/foo/build/linux-x86_64-normal-server-release/images/jdk/bin/java -ea -esa -Xmx512m -XX:-UseCompressedOops -Xms770m TimSortStackSize2 67108864 ]
Error occurred during initialization of VM
Initial heap size set to a larger value than the maximum heap size

Not reproducible and not seen since May last year.

See JDK-8075071 and review thread, in particular: http://mail.openjdk.java.net/pipermail/core-libs-dev/2015-March/032346.html This test has been adjusted multiple times now but continues to fail in some cases. :(

Since the purpose of the test is to verify that the algorithm uses its internal stack correctly then the test can only be run if there is sufficient memory. Given the test matrix and embedded devices, it would be practical if the test was not run (or does not fail) if there is insufficient memory. I'd suggest that the Runtime.maxMemory be compared with the predefined memory requirements (for oop and non-oop case). @requires could be added to the test as a whole for the minimum memory case. What is the purpose of forcing -xms? What is the test configuration in which that matters?

Where is the -Xmx coming from? We need to detect if there is an explicit -Xmx in the applied VM args and replace it with one that is suitable based on the selected -Xms.

Can you suggest a fix for this?

How can this happen? Are we not testing with non-compressed oops?