JDK-6687893 : TEST_BUG: closed/compiler/6321689/Test.java fails with OOM with 64-bit jvm with non-Parallel GCs
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: hs10
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2008-04-13
  • Updated: 2011-04-23
  • Resolved: 2011-04-23
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 Availabitlity Release.

To download the current JDK release, click here.
JDK 6 JDK 7 Other
6u14Fixed 7Fixed hs13Fixed
closed/compiler/6321689/Test.java fails with 
"java.lang.OutOfMemoryError: Java heap space" with 64-bit jvm in case non-Parallel GCs are used.

The problem is that the test requires about 100M to run.
However, the default heap size in case of non-parallel GC is set to 84Mb 
(you can attach jmap to see it).
The default heap size for Parallel GCs is calculated based on amount of available RAM,
so in case of 2Gb the max heap size is set to 512 Mb.
This is why the test doesn't fail with Parallel GCs.

The test needs to be adjusted to run with all collectors or default max heap size
for server-class machines need to be rethinking for non-parallel GCs.

EVALUATION Better yet, follow the advice of the submitter in the suggested fix section.

EVALUATION Set the -Xmx -Xms options on the jtreg command line.

SUGGESTED FIX Looks like the array of chars 'C' could be reduced from size 100 to 50. This will reduce the ammount of objects to allocate in twice and no OOM will happen. The test will be still valid to reproduce the failure. I have checked it by running updated version of the test with: /java/re/jdk/6/promoted/all/b50/binaries/solaris-sparcv9/fastdebug/bin/java -d64 -server -Xbatch -XX:MinProfileTripCountForUnroll=0