JDK-8085982 : java/util/Arrays/ParallelPrefix.java: java.lang.OutOfMemoryError
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util
  • Affected Version: 9
  • Priority: P4
  • Status: Closed
  • Resolution: Cannot Reproduce
  • Submitted: 2015-06-08
  • Updated: 2017-02-28
  • Resolved: 2016-10-24
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.
Other
tbd_minorResolved
Related Reports
Relates :  
Relates :  
Relates :  
Description
jdk9 b68 PIT
java/util/Arrays/ParallelPrefix.java fails with OutOfMemoryError.
Fails quite stable: linux 64 and win64 (4 various hosts).

[TestNG] Running:
  java/util/Arrays/ParallelPrefix.java

test ParallelPrefix.testAIOBEs(): success
test ParallelPrefix.testIAEs(): success
test ParallelPrefix.testNPEs(): success
test ParallelPrefix.testParallelPrefixForDouble([D@3d1bda, 2, 4, ParallelPrefix$$Lambda$50/3026874@1875365): success
test ParallelPrefix.testParallelPrefixForDouble([D@6888c8, 2, 4, ParallelPrefix$$Lambda$51/25311315@c3a5d4): success
test ParallelPrefix.testParallelPrefixForDouble([D@1650429, 2, 5, ParallelPrefix$$Lambda$50/3026874@1875365): success
test ParallelPrefix.testParallelPrefixForDouble([D@b70770, 2, 5, ParallelPrefix$$Lambda$51/25311315@c3a5d4): success
test ParallelPrefix.testParallelPrefixForDouble([D@4de9a8, 3, 6, ParallelPrefix$$Lambda$50/3026874@1875365): success
test ParallelPrefix.testParallelPrefixForDouble([D@140ddf, 3, 6, ParallelPrefix$$Lambda$51/25311315@c3a5d4): success
test ParallelPrefix.testParallelPrefixForDouble([D@182025c, 5, 10, ParallelPrefix$$Lambda$50/3026874@1875365): success
test ParallelPrefix.testParallelPrefixForDouble([D@1f3b036, 5, 10, ParallelPrefix$$Lambda$51/25311315@c3a5d4): success
test ParallelPrefix.testParallelPrefixForDouble([D@18ad7d9, 5, 10, ParallelPrefix$$Lambda$50/3026874@1875365): success
test ParallelPrefix.testParallelPrefixForDouble([D@1a4f3dd, 5, 10, ParallelPrefix$$Lambda$51/25311315@c3a5d4): success
test ParallelPrefix.testParallelPrefixForDouble([D@1e07426, 5, 11, ParallelPrefix$$Lambda$50/3026874@1875365): success
test ParallelPrefix.testParallelPrefixForDouble([D@714229, 5, 11, ParallelPrefix$$Lambda$51/25311315@c3a5d4): success
test ParallelPrefix.testParallelPrefixForDouble([D@1bd8d67, 85, 170, ParallelPrefix$$Lambda$50/3026874@1875365): success
test ParallelPrefix.testParallelPrefixForDouble([D@1df75bc, 85, 170, ParallelPrefix$$Lambda$51/25311315@c3a5d4): success
test ParallelPrefix.testParallelPrefixForDouble([D@70e48b, 85, 170, ParallelPrefix$$Lambda$50/3026874@1875365): success
test ParallelPrefix.testParallelPrefixForDouble([D@aca85, 85, 170, ParallelPrefix$$Lambda$51/25311315@c3a5d4): success
test ParallelPrefix.testParallelPrefixForDouble([D@317eb2, 85, 171, ParallelPrefix$$Lambda$50/3026874@1875365): success
test ParallelPrefix.testParallelPrefixForDouble([D@1d5101b, 85, 171, ParallelPrefix$$Lambda$51/25311315@c3a5d4): success
test ParallelPrefix.testParallelPrefixForDouble([D@1fb0b6, 5461, 10922, ParallelPrefix$$Lambda$50/3026874@1875365): success
test ParallelPrefix.testParallelPrefixForDouble([D@1c4b928, 5461, 10922, ParallelPrefix$$Lambda$51/25311315@c3a5d4): success
test ParallelPrefix.testParallelPrefixForDouble([D@1f6638f, 5461, 10922, ParallelPrefix$$Lambda$50/3026874@1875365): success
test ParallelPrefix.testParallelPrefixForDouble([D@f1aca6, 5461, 10922, ParallelPrefix$$Lambda$51/25311315@c3a5d4): success
test ParallelPrefix.testParallelPrefixForDouble([D@15c5b79, 5461, 10923, ParallelPrefix$$Lambda$50/3026874@1875365): success
test ParallelPrefix.testParallelPrefixForDouble([D@a4d4ff, 5461, 10923, ParallelPrefix$$Lambda$51/25311315@c3a5d4): success
test ParallelPrefix.testParallelPrefixForInt([I@3fc18b, 2, 4, ParallelPrefix$$Lambda$55/11601475@130dc40): success
test ParallelPrefix.testParallelPrefixForInt([I@1c81e50, 2, 4, ParallelPrefix$$Lambda$56/1056774@1cbb6fb): success
test ParallelPrefix.testParallelPrefixForInt([I@2a729d, 2, 5, ParallelPrefix$$Lambda$55/11601475@130dc40): success
test ParallelPrefix.testParallelPrefixForInt([I@141ce6b, 2, 5, ParallelPrefix$$Lambda$56/1056774@1cbb6fb): success
test ParallelPrefix.testParallelPrefixForInt([I@1c10ecd, 3, 6, ParallelPrefix$$Lambda$55/11601475@130dc40): success
test ParallelPrefix.testParallelPrefixForInt([I@1aec66f, 3, 6, ParallelPrefix$$Lambda$56/1056774@1cbb6fb): success
test ParallelPrefix.testParallelPrefixForInt([I@127cd85, 5, 10, ParallelPrefix$$Lambda$55/11601475@130dc40): success
test ParallelPrefix.testParallelPrefixForInt([I@1e9c60b, 5, 10, ParallelPrefix$$Lambda$56/1056774@1cbb6fb): success
test ParallelPrefix.testParallelPrefixForInt([I@5dfdf3, 5, 10, ParallelPrefix$$Lambda$55/11601475@130dc40): success
test ParallelPrefix.testParallelPrefixForInt([I@dd5375, 5, 10, ParallelPrefix$$Lambda$56/1056774@1cbb6fb): success
test ParallelPrefix.testParallelPrefixForInt([I@3e089, 5, 11, ParallelPrefix$$Lambda$55/11601475@130dc40): success
test ParallelPrefix.testParallelPrefixForInt([I@14be927, 5, 11, ParallelPrefix$$Lambda$56/1056774@1cbb6fb): success
test ParallelPrefix.testParallelPrefixForInt([I@70e2fc, 85, 170, ParallelPrefix$$Lambda$55/11601475@130dc40): success
test ParallelPrefix.testParallelPrefixForInt([I@18ea9ca, 85, 170, ParallelPrefix$$Lambda$56/1056774@1cbb6fb): success
test ParallelPrefix.testParallelPrefixForInt([I@1262c03, 85, 170, ParallelPrefix$$Lambda$55/11601475@130dc40): success
test ParallelPrefix.testParallelPrefixForInt([I@181c588, 85, 170, ParallelPrefix$$Lambda$56/1056774@1cbb6fb): success
test ParallelPrefix.testParallelPrefixForInt([I@10f0d3, 85, 171, ParallelPrefix$$Lambda$55/11601475@130dc40): success
test ParallelPrefix.testParallelPrefixForInt([I@1ebfde5, 85, 171, ParallelPrefix$$Lambda$56/1056774@1cbb6fb): success
test ParallelPrefix.testParallelPrefixForInt([I@f53269, 5461, 10922, ParallelPrefix$$Lambda$55/11601475@130dc40): success
test ParallelPrefix.testParallelPrefixForInt([I@1d75c2, 5461, 10922, ParallelPrefix$$Lambda$56/1056774@1cbb6fb): success
test ParallelPrefix.testParallelPrefixForInt([I@f2f0e7, 5461, 10922, ParallelPrefix$$Lambda$55/11601475@130dc40): success
test ParallelPrefix.testParallelPrefixForInt([I@21c5bc, 5461, 10922, ParallelPrefix$$Lambda$56/1056774@1cbb6fb): success
test ParallelPrefix.testParallelPrefixForInt([I@1820649, 5461, 10923, ParallelPrefix$$Lambda$55/11601475@130dc40): success
test ParallelPrefix.testParallelPrefixForInt([I@f19f0c, 5461, 10923, ParallelPrefix$$Lambda$56/1056774@1cbb6fb): success
test ParallelPrefix.testParallelPrefixForLong([J@1a0a8db, 2, 4, ParallelPrefix$$Lambda$59/20170531@b18dcf): success
test ParallelPrefix.testParallelPrefixForLong([J@cf6312, 2, 4, ParallelPrefix$$Lambda$60/11107535@d5e760): success
test ParallelPrefix.testParallelPrefixForLong([J@6f1580, 2, 5, ParallelPrefix$$Lambda$59/20170531@b18dcf): success
test ParallelPrefix.testParallelPrefixForLong([J@7e2541, 2, 5, ParallelPrefix$$Lambda$60/11107535@d5e760): success
test ParallelPrefix.testParallelPrefixForLong([J@411b9a, 3, 6, ParallelPrefix$$Lambda$59/20170531@b18dcf): success
test ParallelPrefix.testParallelPrefixForLong([J@1a41746, 3, 6, ParallelPrefix$$Lambda$60/11107535@d5e760): success
test ParallelPrefix.testParallelPrefixForLong([J@1131a71, 5, 10, ParallelPrefix$$Lambda$59/20170531@b18dcf): success
test ParallelPrefix.testParallelPrefixForLong([J@1c5c6bf, 5, 10, ParallelPrefix$$Lambda$60/11107535@d5e760): success
test ParallelPrefix.testParallelPrefixForLong([J@131e8f4, 5, 10, ParallelPrefix$$Lambda$59/20170531@b18dcf): success
test ParallelPrefix.testParallelPrefixForLong([J@1e9e33f, 5, 10, ParallelPrefix$$Lambda$60/11107535@d5e760): success
test ParallelPrefix.testParallelPrefixForLong([J@5ad111, 5, 11, ParallelPrefix$$Lambda$59/20170531@b18dcf): success
test ParallelPrefix.testParallelPrefixForLong([J@168badc, 5, 11, ParallelPrefix$$Lambda$60/11107535@d5e760): success
test ParallelPrefix.testParallelPrefixForLong([J@9a23ed, 85, 170, ParallelPrefix$$Lambda$59/20170531@b18dcf): success
test ParallelPrefix.testParallelPrefixForLong([J@1095c04, 85, 170, ParallelPrefix$$Lambda$60/11107535@d5e760): success
test ParallelPrefix.testParallelPrefixForLong([J@17bb1d2, 85, 170, ParallelPrefix$$Lambda$59/20170531@b18dcf): success
test ParallelPrefix.testParallelPrefixForLong([J@1f787d9, 85, 170, ParallelPrefix$$Lambda$60/11107535@d5e760): success
test ParallelPrefix.testParallelPrefixForLong([J@26434d, 85, 171, ParallelPrefix$$Lambda$59/20170531@b18dcf): success
test ParallelPrefix.testParallelPrefixForLong([J@77d2f6, 85, 171, ParallelPrefix$$Lambda$60/11107535@d5e760): success
test ParallelPrefix.testParallelPrefixForLong([J@149674b, 5461, 10922, ParallelPrefix$$Lambda$59/20170531@b18dcf): success
test ParallelPrefix.testParallelPrefixForLong([J@276d72, 5461, 10922, ParallelPrefix$$Lambda$60/11107535@d5e760): success
test ParallelPrefix.testParallelPrefixForLong([J@d7f7cc, 5461, 10922, ParallelPrefix$$Lambda$59/20170531@b18dcf): success
test ParallelPrefix.testParallelPrefixForLong([J@576ee4, 5461, 10922, ParallelPrefix$$Lambda$60/11107535@d5e760): success
test ParallelPrefix.testParallelPrefixForLong([J@7d3687, 5461, 10923, ParallelPrefix$$Lambda$59/20170531@b18dcf): success
test ParallelPrefix.testParallelPrefixForLong([J@c9850f, 5461, 10923, ParallelPrefix$$Lambda$60/11107535@d5e760): success
test ParallelPrefix.testParallelPrefixForStringr([Ljava.lang.String;@7becc7, 2, 4, ParallelPrefix$$Lambda$63/4012150@bdc2ed): success
test ParallelPrefix.testParallelPrefixForStringr([Ljava.lang.String;@7f16a0, 2, 5, ParallelPrefix$$Lambda$63/4012150@bdc2ed): success
test ParallelPrefix.testParallelPrefixForStringr([Ljava.lang.String;@1b3d3db, 3, 6, ParallelPrefix$$Lambda$63/4012150@bdc2ed): success
test ParallelPrefix.testParallelPrefixForStringr([Ljava.lang.String;@d51467, 5, 10, ParallelPrefix$$Lambda$63/4012150@bdc2ed): success
test ParallelPrefix.testParallelPrefixForStringr([Ljava.lang.String;@2242d3, 5, 10, ParallelPrefix$$Lambda$63/4012150@bdc2ed): success
test ParallelPrefix.testParallelPrefixForStringr([Ljava.lang.String;@85e89d, 5, 11, ParallelPrefix$$Lambda$63/4012150@bdc2ed): success
test ParallelPrefix.testParallelPrefixForStringr([Ljava.lang.String;@4623c6, 85, 170, ParallelPrefix$$Lambda$63/4012150@bdc2ed): success
test ParallelPrefix.testParallelPrefixForStringr([Ljava.lang.String;@4274dc, 85, 170, ParallelPrefix$$Lambda$63/4012150@bdc2ed): success
test ParallelPrefix.testParallelPrefixForStringr([Ljava.lang.String;@1792ce7, 85, 171, ParallelPrefix$$Lambda$63/4012150@bdc2ed): success
test ParallelPrefix.testParallelPrefixForStringr([Ljava.lang.String;@22b9ca, 5461, 10922, ParallelPrefix$$Lambda$63/4012150@bdc2ed): failure
java.lang.OutOfMemoryError
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:425)
	at java.util.concurrent.ForkJoinTask.getThrowableException(ForkJoinTask.java:598)
	at java.util.concurrent.ForkJoinTask.reportException(ForkJoinTask.java:677)
	at java.util.concurrent.ForkJoinTask.invoke(ForkJoinTask.java:735)
	at java.util.Arrays.parallelPrefix(Arrays.java:1595)
	at ParallelPrefix.testParallelPrefixForStringr(ParallelPrefix.java:175)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:502)
	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
	at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
	at org.testng.TestRunner.privateRun(TestRunner.java:767)
	at org.testng.TestRunner.run(TestRunner.java:617)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
	at org.testng.SuiteRunner.run(SuiteRunner.java:240)
	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
	at org.testng.TestNG.run(TestNG.java:1057)
	at com.sun.javatest.regtest.TestNGAction$TestNGRunner.main(TestNGAction.java:163)
	at com.sun.javatest.regtest.TestNGAction$TestNGRunner.main(TestNGAction.java:147)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:502)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:92)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.OutOfMemoryError: Java heap space
test ParallelPrefix.testParallelPrefixForStringr([Ljava.lang.String;@5d4f9d, 5461, 10922, ParallelPrefix$$Lambda$63/4012150@bdc2ed): failure
java.lang.OutOfMemoryError
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:425)
	at java.util.concurrent.ForkJoinTask.getThrowableException(ForkJoinTask.java:598)
	at java.util.concurrent.ForkJoinTask.reportException(ForkJoinTask.java:677)
	at java.util.concurrent.ForkJoinTask.invoke(ForkJoinTask.java:735)
	at java.util.Arrays.parallelPrefix(Arrays.java:1595)
	at ParallelPrefix.testParallelPrefixForStringr(ParallelPrefix.java:175)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:502)
	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
	at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
	at org.testng.TestRunner.privateRun(TestRunner.java:767)
	at org.testng.TestRunner.run(TestRunner.java:617)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
	at org.testng.SuiteRunner.run(SuiteRunner.java:240)
	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
	at org.testng.TestNG.run(TestNG.java:1057)
	at com.sun.javatest.regtest.TestNGAction$TestNGRunner.main(TestNGAction.java:163)
	at com.sun.javatest.regtest.TestNGAction$TestNGRunner.main(TestNGAction.java:147)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:502)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:92)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.OutOfMemoryError: Java heap space
test ParallelPrefix.testParallelPrefixForStringr([Ljava.lang.String;@188040b, 5461, 10923, ParallelPrefix$$Lambda$63/4012150@bdc2ed): success

===============================================
java/util/Arrays/ParallelPrefix.java
Total tests run: 87, Failures: 2, Skips: 0
===============================================
Comments
So if this test requires a lot of memory why doesn't the test specify -Xmx? Looks like a testbug to me.
28-02-2017

Quick solution for you is to adjust --Xmx to some greater value (for example 265M on my local) when running the tests.
28-02-2017

This happens every single night in the Hotspot nightlies. If it wasn't reproducible before it certainly is now.
27-02-2017

The parallel prefix for strings uses a concatenation function, initially the string array is filled with the strings of the correspond array indexes. For large arrays this can consume a fair bit of memory (consider the arithemtic series of integers as an approximate case for the number of characters in each string in the series), and in the parallel case there will be more memory churn as intermediate cumulations are "patched". For strings an array length reduction, from say 2^14 to 2^10, will probably reduce the memory usage to more reasonable levels
03-01-2017

JDK-8162519 removed this test from ProblemList.txt, see if the issue resurfaces. If no issue happens in next few weeks, will close the issue.
28-09-2016