United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-7091032 G1: assert failure when NewRatio is used
JDK-7091032 : G1: assert failure when NewRatio is used

Details
Type:
Bug
Submit Date:
2011-09-15
Status:
Closed
Updated Date:
2012-12-05
Project Name:
JDK
Resolved Date:
2012-01-23
Component:
hotspot
OS:
generic
Sub-Component:
gc
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
hs22
Fixed Versions:
hs23 (b02)

Related Reports
Backport:
Backport:
Backport:
Backport:

Sub Tasks

Description
If we explicitly set the NewRatio parameter, G1 fails with the following:

#  Internal Error (/scratch/tony/ws/hsx-gc-tclone/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp:516), pid=23271, tid=2
#  assert(initial_region_num <= _max_desired_young_length) failed: Initial young gen size too large

                                    

Comments
SUGGESTED FIX

See Evaluation.
                                     
2011-09-15
EVALUATION

The failure is caused by the following

void G1CollectorPolicy::init() {
  ...
  size_t heap_regions = sizer.size_to_region_num(_g1->n_regions());
  update_young_list_size_using_newratio(heap_regions);

size_to_region_num() takes a byte size and translates it to a region num, so passing a region number to it is incorrect and causes the calculations to be wrong (the min and max desired young length end up being 0).

The fix is to directly pass _g1->n_regions() to update_young_list_size_using_newratio().
                                     
2011-09-15
EVALUATION

http://hg.openjdk.java.net/hsx/hotspot-gc/hotspot/rev/d912b598c6c3
                                     
2011-09-22
EVALUATION

http://hg.openjdk.java.net/hsx/hsx22/hotspot/rev/ac196b091535
                                     
2011-10-12
EVALUATION

This scenario should be included in CLI testing.
Verified in HS22 7u2 8 for JDK 7u2 b10 &  HS23 b02 for JDK8 b10.

Here is log:

gtee@sc14160074 7092238 $ /java/re/jdk/7u2/promoted/all/b09/binaries/solaris-sparc/fastdebug/bin/java  -XX:+UseG1GC -XX:+PrintGCDetails -XX:NewRatio=1
VM option '+UseG1GC'
VM option '+PrintGCDetails'
VM option 'NewRatio=1'
# To suppress the following error report, specify this argument
# after -XX: or in .hotspotrc:  SuppressErrorAt=/g1CollectorPolicy.cpp:516
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/export/HUDSON/workspace/jdk7u2-2-build-solaris-sparc-product/jdk7u2/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp:516), pid=27715, tid=2
#  assert(initial_region_num <= _max_desired_young_length) failed: Initial young gen size too large
#
# JRE version: 7.0_02-b09
# Java VM: Java HotSpot(TM) Server VM (22.0-b07-fastdebug mixed mode solaris-sparc )
# Core dump written. Default location: /import/gtee/g1/7092238/core or core.27715
#
# An error report file with more information is saved as:
# /import/gtee/g1/7092238/hs_err_pid27715.log
Phoning home... 
Using server: 10.161.186.18, port 4711
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.sun.com/bugreport/crash.jsp
#
Current thread is 2
Dumping core ...
^CAbort
gtee@sc14160074 7092238 $ ^C
gtee@sc14160074 7092238 $ ^C
gtee@sc14160074 7092238 $ /net/sqenfs-1.us.oracle.com/export1/comp/vm/jdk/hsx/pit/8/fastdebug/solaris-sparc/bin/java -XX:+UseG1GC -XX:+PrintGCDetails -XX:NewRatio=1       
VM option '+UseG1GC'
VM option '+PrintGCDetails'
VM option 'NewRatio=1'
Usage: java [-options] class [args...]
.....

net/sqenfs-1.us.oracle.com/export1/comp/vm/jdk/hsx/pit/7u2/fastdebug/solaris-sparc/bin/java -XX:+UseG1GC -XX:+PrintGCDetails -XX:NewRatio=1
VM option '+UseG1GC'
VM option '+PrintGCDetails'
VM option 'NewRatio=1'
...
                                     
2011-10-17
EVALUATION

See main CR
                                     
2011-10-22



Hardware and Software, Engineered to Work Together