United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6687893 TEST_BUG: closed/compiler/6321689/Test.java fails with OOM with 64-bit jvm with non-Parallel GCs
JDK-6687893 : TEST_BUG: closed/compiler/6321689/Test.java fails with OOM with 64-bit jvm with non-Parallel GCs

Details
Type:
Bug
Submit Date:
2008-04-13
Status:
Closed
Updated Date:
2011-04-23
Project Name:
JDK
Resolved Date:
2011-04-23
Component:
hotspot
OS:
generic
Sub-Component:
compiler
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
hs10
Fixed Versions:
hs13 (b01)

Related Reports
Backport:
Backport:

Sub Tasks

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
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
EVALUATION

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

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



Hardware and Software, Engineered to Work Together