United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-6472335 : Allocation of huge array which would cause OutOfMemoryError causes JVM to hang with -Xincgc

Details
Type:
Bug
Submit Date:
2006-09-19
Status:
Closed
Updated Date:
2012-03-22
Project Name:
JDK
Resolved Date:
2011-03-07
Component:
hotspot
OS:
solaris,generic
Sub-Component:
gc
CPU:
sparc,generic
Priority:
P2
Resolution:
Fixed
Affected Versions:
6
Fixed Versions:
hs10 (b03)

Related Reports
Backport:
Backport:
Backport:
Backport:
Duplicate:
Duplicate:
Relates:
Relates:

Sub Tasks

Description
The following simple program when run with -Xincgc (or with -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode) causes JVM to hang.

public class Allocate {
        public static void main(String[] args) {
                int size = Integer.parseInt(args[0]);
                int[] arr = new int[size];
        }
}

                                    

Comments
SUGGESTED FIX

--- For diffs, see PRT webrev below ---
                                     
2006-09-19
EVALUATION

The changes in 6415406 have unmasked a long-standing bug in
CMSCollector::allocation_limit_reached() which does not
correctly account for the possibility of arithmetic overflow
when doing range / threshold-crossing checks involving
large allocation requests.
                                     
2006-09-19
WORK AROUND

None known, except to not use -Xincgc, instead using -Xconcgc
(i.e. the non-incremental version of CMS).
                                     
2006-09-19
EVALUATION

The fix should be backported to 6u1, 5u10 and any other update release
to which 6415406 has been backported.
                                     
2006-09-20
SUGGESTED FIX

Event:            putback-to
Parent workspace: /net/jano.sfbay/export/disk05/hotspot/ws/main/gc_baseline
                  (jano.sfbay:/export/disk05/hotspot/ws/main/gc_baseline)
Child workspace:  /net/prt-web/prt-workspaces/20060922160805.ysr.bot/workspace
                  (prt-web:/net/prt-web/prt-workspaces/20060922160805.ysr.bot/workspace)
User:             ysr

Comment:

---------------------------------------------------------

Job ID:                 20060922160805.ysr.bot
Original workspace:     karachi:/net/spot/scratch/ysr/bot
Submitter:              ysr
Archived data:          /net/prt-archiver.sfbay/data/archived_workspaces/main/gc_baseline/2006/20060922160805.ysr.bot/
Webrev:                 http://analemma.sfbay.sun.com/net/prt-archiver.sfbay/data/archived_workspaces/main/gc_baseline/2006/20060922160805.ysr.bot/workspace/webrevs/webrev-2006.09.22/index.html

Fixed 6472335: Allocation of huge array which would cause OutOfMemoryError causes JVM to hang with -Xincgc. 

  Webrev: http://analemma.sfbay/net/spot/scratch/ysr/bot/webrev

A predicate computation in CMSGen::allocation_limit_reached()
was overflowing. This day-one bug was unmasked because of the
recent (b92) fix for CR 6415406.

Reviewed by: Andrey Petrusenko

Fix Verified: yes

Verification Testing: test in bug report

Other testing: PRT & refworload ?? incgc ?? concgc

Files:
update: src/share/vm/memory/concurrentMarkSweepGeneration.cpp

Examined files: 3878

Contents Summary:
       1   update
    3877   no action (unchanged)
                                     
2006-09-25



Hardware and Software, Engineered to Work Together