JDK-7091032 : G1: assert failure when NewRatio is used
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: hs22
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2011-09-15
  • Updated: 2013-09-18
  • Resolved: 2012-01-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 Availability Release.

To download the current JDK release, click here.
JDK 7 JDK 8 Other
7u2Fixed 8Fixed hs22Fixed
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
EVALUATION See main CR
22-10-2011

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

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

SUGGESTED FIX See Evaluation.
15-09-2011

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().
15-09-2011