JDK-7092238 : G1: Uninitialized field gc_efficiency in G1PrintRegionLivenessInfo output
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 7
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: linux
  • CPU: x86
  • Submitted: 2011-09-19
  • 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
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 main CR
22-10-2011

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

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

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.
22-09-2011

EVALUATION See Public Comments.
20-09-2011

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