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

Comments
EVALUATION Better yet, follow the advice of the submitter in the suggested fix section.
2008-04-23

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

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
2008-04-13