JDK-8190679 : java/util/Arrays/TimSortStackSize2.java fails with "Initial heap size set to a larger value than the maximum heap size"
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util
  • Affected Version: 10,11
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2017-11-03
  • Updated: 2021-03-23
  • Resolved: 2018-02-28
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 11 Other
11 b04Fixed openjdk8u302Fixed
Related Reports
Relates :  
Relates :  
Description
java/util/Arrays/TimSortStackSize2.java could fail with "Initial heap size set to a larger value than the maximum heap size" in case small -Xmx is passed during test execution.

Failure example:
----------System.out:(5/611)----------
compressedOops: false; Test will be started with "-Xms770m"
Command line: [linux-x64-debug.jdk/jdk-10/fastdebug/bin/java -ea -esa -Xmx512m -Xcomp -XX:+CreateCoredumpOnCrash -ea -esa -XX:CompileThreshold=100 -XX:+UnlockExperimentalVMOptions -server -XX:+TieredCompilation -XX:+IgnoreUnrecognizedVMOptions -XX:+AggressiveOpts -XX:-UseCompressedOops -Xms770m TimSortStackSize2 67108864 ]
Error occurred during initialization of VM
Initial heap size set to a larger value than the maximum heap size

----------System.err:(38/2136)----------
 stdout: [Error occurred during initialization of VM
Initial heap size set to a larger value than the maximum heap size
];
 stderr: []
 exitValue = 1

Comments
Review approval: https://mail.openjdk.java.net/pipermail/jdk8u-dev/2021-March/013553.html
18-03-2021

Fix Request (JDK8u) Request for this changeset to be backported to JDK8u as part of a set of changes to prevent an OOM being thrown during a -XX:-UseCompressedOops run (See JDK-8263099). https://cr.openjdk.java.net/~phh/8190679/webrev.8u.jdk.01/ Note: Please merge this backport *after* the backport in 8075071, as this change depends on it. https://bugs.openjdk.java.net/browse/JDK-8075071
15-03-2021

http://cr.openjdk.java.net/~iignatyev//8190679/webrev.00/index.html
26-02-2018

so it's JDK-8079378
15-11-2017

the test passed in jdk testing, b/c UseCompressedOops is on by default, so the test uses -Xms385[1], w/ -XX:-UseCompressedOops it will use Xms770 which is more than default Xmx512. [1] Boolean compressedOops = WhiteBox.getWhiteBox() .getBooleanVMFlag("UseCompressedOops"); final String xmsValue = "-Xms" + ((compressedOops == null || compressedOops) ? "385" : "770") + "m";
15-11-2017

I don't know. Looking at http://java.se.oracle.com:10065/mdash/jobs/mach5-one-jdk-20171115-2130-4945?search=tier1 it runs the test in question and it has -vmoption:-Xmx512m in the jtreg command line.
15-11-2017

if TestCommon.gmk sets -Xmx512m by default for all tests, I'd assume this test should always fail. why hasn't this test been failing in jdk/jdk CI?
15-11-2017

TestCommon.gmk sets -Xmx512m by default for all tests using -vmoption to jtreg. If the test needs to set -Xms to something larger than that, I would say it should also set mx to a reasonable matching value.
15-11-2017

in any case, the test should be updated to properly handle externally provided Xmx/Xms values.
15-11-2017

interestingly enough, -Xmx512m hasn't come from the test task, it sets only [1], so it seems that -Xmx come from jib/make[2]. [~erikj] [~ihse], could you please take a look why we get this Xmx value? [1] "jvmArg" : "-Xcomp -XX:+CreateCoredumpOnCrash -ea -esa -XX:CompileThreshold=100 -XX:+UnlockExperimentalVMOptions -server -XX:+TieredCompilation -XX:+IgnoreUnrecognizedVMOptions -XX:+AggressiveOpts -XX:-UseCompressedOops" [2] jib > [jib LOG] make CONF_NAME=run-test-prebuilt TEST_OUTPUT_DIR=/scratch/opt/mach5/mesos/work_dir/slaves/7aed79a7-ea87-4caa-8895-f1d7e69bb48e-S3995/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/ccedece1-1bc2-4e95-9320-a585cb7d9a93/runs/5bd4f40c-6671-4112-8e07-94b0d4370dc4/./testoutput TESTDIRS=../open/test/jdk TEST_SELECTION=:jdk_util EXTRA_JTREG_OPTIONS=-k:!headful -xml:verify JTREG_VERBOSE=fail,error,time USE_FAILURE_HANDLER=true JTREG_TIMEOUT_OPTION=-timeoutFactor:10 CONCURRENCY=6 JAVA_ARGS=-Xcomp -XX:+CreateCoredumpOnCrash -ea -esa -XX:CompileThreshold=100 -XX:+UnlockExperimentalVMOptions -server -XX:+TieredCompilation -XX:+IgnoreUnrecognizedVMOptions -XX:+AggressiveOpts -XX:-UseCompressedOops jtreg_tests jib > make OPEN_ONLY=true --no-print-directory TESTDIRS=jdk \ jib > jdk_jtreg_tests jib > ( \ jib > ( JT_HOME=/scratch/opt/mach5/mesos/work_dir/jib-master/install/java/re/jtreg/4.2/promoted/all/b09/bundles/jtreg_bin-4.2.zip/jtreg; \ jib > export JT_HOME; \ jib > /scratch/opt/mach5/mesos/work_dir/jib-master/install/java/re/jtreg/4.2/promoted/all/b09/bundles/jtreg_bin-4.2.zip/jtreg/bin/jtreg \ jib > -concurrency:6 -k:!headful -xml:verify -agentvm -a -ea -esa -v:fail,error,time -retain:fail,error -ignore:quiet -timeoutFactor:10 -J-Xmx512m -e:JIB_DATA_DIR -e:JDK8_HOME=/scratch/opt/mach5/mesos/work_dir/jib-master/install/jdk/9/181/bundles/linux-x64/jdk-9_linux-x64_bin.tar.gz/jdk-9 -cpa:/scratch/opt/mach5/mesos/work_dir/jib-master/install/com/oracle/java/jib/jib/3.0-SNAPSHOT/jib-3.0-SNAPSHOT-distribution.zip/jib-3.0-SNAPSHOT-distribution/lib/jib-3.0-SNAPSHOT.jar \ jib > -r:/scratch/opt/mach5/mesos/work_dir/slaves/7aed79a7-ea87-4caa-8895-f1d7e69bb48e-S3995/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/ccedece1-1bc2-4e95-9320-a585cb7d9a93/runs/5bd4f40c-6671-4112-8e07-94b0d4370dc4/testoutput/jtreg/JTreport \ jib > -w:/scratch/opt/mach5/mesos/work_dir/slaves/7aed79a7-ea87-4caa-8895-f1d7e69bb48e-S3995/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/ccedece1-1bc2-4e95-9320-a585cb7d9a93/runs/5bd4f40c-6671-4112-8e07-94b0d4370dc4/testoutput/jtreg/JTwork \ jib > -jdk:/scratch/opt/mach5/mesos/work_dir/jib-master/install/2017-10-31-1734415.vm-sqe-notifications_ww_grp.integ-jdk10-hs/linux-x64-debug.jdk/jdk-10/fastdebug \ jib > -nativepath:/scratch/opt/mach5/mesos/work_dir/jib-master/install/2017-10-31-1734415.vm-sqe-notifications_ww_grp.integ-jdk10-hs/linux-x64-debug.test/jdk/jtreg/native \ jib > -timeoutHandlerDir:/scratch/opt/mach5/mesos/work_dir/jib-master/install/2017-10-31-1734415.vm-sqe-notifications_ww_grp.integ-jdk10-hs/linux-x64-debug.test/failure_handler/jtregFailureHandler.jar -observerDir:/scratch/opt/mach5/mesos/work_dir/jib-master/install/2017-10-31-1734415.vm-sqe-notifications_ww_grp.integ-jdk10-hs/linux-x64-debug.test/failure_handler/jtregFailureHandler.jar -timeoutHandler:jdk.test.failurehandler.jtreg.GatherProcessInfoTimeoutHandler -observer:jdk.test.failurehandler.jtreg.GatherDiagnosticInfoObserver -timeoutHandlerTimeout:0 \ jib > -exclude:/scratch/opt/mach5/mesos/work_dir/jib-master/install/2017-10-31-1734415.vm-sqe-notifications_ww_grp.integ-jdk10-hs/src.full/open/test/jdk/ProblemList.txt \ jib > -vmoption:-Xmx512m -javaoptions:-Xcomp -javaoptions:-XX:+CreateCoredumpOnCrash -javaoptions:-ea -javaoptions:-esa -javaoptions:-XX:CompileThreshold=100 -javaoptions:-XX:+UnlockExperimentalVMOptions -javaoptions:-server -javaoptions:-XX:+TieredCompilation -javaoptions:-XX:+IgnoreUnrecognizedVMOptions -javaoptions:-XX:+AggressiveOpts -javaoptions:-XX:-UseCompressedOops \ jib > /scratch/opt/mach5/mesos/work_dir/jib-master/install/2017-10-31-1734415.vm-sqe-notifications_ww_grp.integ-jdk10-hs/src.full/open/test/jdk/:jdk_util \ jib > ) ;
15-11-2017