United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-7092238 G1: Uninitialized field gc_efficiency in G1PrintRegionLivenessInfo output
JDK-7092238 : G1: Uninitialized field gc_efficiency in G1PrintRegionLivenessInfo output

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

Related Reports
Backport:
Backport:
Backport:
Backport:

Sub Tasks

Description
FULL PRODUCT VERSION :


A DESCRIPTION OF THE PROBLEM :
When enabling G1PrintRegionLivenessInfo, the first time you get a report you may get random values in the "gc-eff" column.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run Hotspot-VM with -XX:+G1PrintRegionLivenessInfo and -XX:+UseG1GC with a sufficently large benchmark to cause concurrent marking start.



EXPECTED VERSUS ACTUAL BEHAVIOR :
Some values for the "gc-eff" column of the output read "nan" for free regions.
REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER SUBMITTED WORKAROUND :
Suggestions for fixing have been added to https://bugs.openjdk.java.net/show_bug.cgi?id=100197

                                    

Comments
EVALUATION

See Public Comments.
                                     
2011-09-20
PUBLIC COMMENTS

It looks indeed as if the _gc_efficiency field of the HeapRegion class is not initialized properly.
                                     
2011-09-20
PUBLIC COMMENTS

FWIW, I reproduced the issue on linux with a debug build:

### PHASE Post-Marking @ 27.377
### HEAP  committed: 0xaae00000-0xaee00000  reserved: 0xaae00000-0xaee00000  region-size: 1048576
###
###   type         address-range       used  prev-live  next-live          gc-eff
###                                 (bytes)    (bytes)    (bytes)      (bytes/ms)
###   OLD  0xaae00000-0xaaf00000    1048576    1048576     149232  -7478635795308384178678626234477338765623121979189748343809653167004330313976030486954447383286129802186779679841804100646674790742262819242223986790247088643994984488195310211210345403332642667378471000230265516264857328262241129957569855488.0
###   FREE 0xaaf00000-0xab000000          0          0          0  -7478635795308384178678626234477338765623121979189748343809653167004330313976030486954447383286129802186779679841804100

and initializing the _gc_efficiency field to 0.0 does indeed solve the problem.
                                     
2011-09-22
EVALUATION

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

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

Verifiid in PIT of HS22 b08 for JDK 7u2 b10 & HS23 b02 for JDK8 b10.

zero is used in log.

/net/sqenfs-1.us.oracle.com/export1/comp/vm/jdk/hsx/pit/8/fastdebug/solaris-sparc/bin/java -XX:+UseG1GC -XX:+PrintGCDetails -XX:+G1PrintRegionLivenessInfo -jar /net/sqenfs-1.us.oracle.com/export1/comp/vm/testbase/bigapps/Dacapo/execution/dacapo.jar batik > log.8 
less log.8
...
###   type         address-range       used  prev-live  next-live          gc-eff
###                                 (bytes)    (bytes)    (bytes)      (bytes/ms)
###   OLD  0xb5000000-0xb5100000     897992     897992     505024             0.0
###   EDEN 0xb5100000-0xb5200000     212440     212440     212440             0.0
###   FREE 0xb5200000-0xb5300000          0          0          0             0.0
###   SURV 0xb5300000-0xb5400000     835584     835584     596232             0.0
###   OLD  0xb5400000-0xb5500000    1048576    1048576     685912             0.0
###   OLD  0xb5500000-0xb5600000     455512     455512     395264             0.0
###
### SUMMARY  capacity: 6.00 MB  used: 3.29 MB / 54.84 %  prev-live: 3.29 MB / 54.84 %  next-live: 2.28 MB / 38.07 %

instead 

###   type         address-range       used  prev-live  next-live          gc-eff
###   OLD  0xb5000000-0xb5100000     897888     897888     505080  -7478635795308384178678626234477338765623121979189748343809653167004330313976030486954447383286129802186779679841804100646674790742262819242223986790247088643994984488195310211210345403332642667378471000230265516264857328262241129957569855488.0
###   EDEN 0xb5100000-0xb5200000      99408      99408      99408  -7478635795308384178678626234477338765623121979189748343809653167004330313976030486954447383286129802186779679841804100646674790742262819242223986790247088643994984488195310211210345403332642667378471000230265516264857328262241129957569855488.0
###   OLD  0xb5200000-0xb5300000    1048576    1048576     499360  -7478635795308384178678626234477338765623121979189748343809653167004330313976030486954447383286129802186779679841804100646674790742262819242223986790247088643994984488195310211210345403332642667378471000230265516264857328262241129957569855488.0
###   OLD  0xb5300000-0xb5400000    1048576    1048576     718472  -7478635795308384178678626234477338765623121979189748343809653167004330313976030486954447383286129802186779679841804100646674790742262819242223986790247088643994984488195310211210345403332642667378471000230265516264857328262241129957569855488.0
###   OLD  0xb5400000-0xb5500000     578696     578696     207912  -7478635795308384178678626234477338765623121979189748343809653167004330313976030486954447383286129802186779679841804100646674790742262819242223986790247088643994984488195310211210345403332642667378471000230265516264857328262241129957569855488.0
###
### SUMMARY  capacity: 5.00 MB  used: 3.50 MB / 70.06 %  prev-live: 3.50 MB / 70.06 %  next-live: 1.94 MB / 38.72 %
                                     
2011-10-17
EVALUATION

See main CR
                                     
2011-10-22



Hardware and Software, Engineered to Work Together