JDK-6882730 : G1: parallel heap verification messes up region dump
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: hs17
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2009-09-16
  • Updated: 2013-09-18
  • Resolved: 2009-11-11
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 6 JDK 7 Other
6u21Fixed 7Fixed hs16Fixed
Related Reports
Relates :  
Description
If heap verification fails, G1 dumps the per-region information. If parallel heap verification is enabled (with -XX:+GCParallelVerificationEnabled), under certain circumstances, the per region information is totally messed up and unreadable. Here's a fragment of an example:

 [0xfffffffeaf700000, 0xfffffffeaf700000, 0xfffffffeaf800000)
    space 1024K, 100% used [0xffffffff4ce00000, 0xffffffff4cf00000, 0xffffffff4cf00000)
                     661    F    [0xffffffff23500000, 0xffffffff23600000, 0xffffffff23600000)
 space 1024K, 100% used 1416    F         space 1024K,   0% used [0xffffffff2cc00000, 0xffffffff2cd00000, 0xffffffff2cd00000)
 1412 83       F    [0xfffffffeaf800000, 0xfffffffeaf800000, 0xfffffffeaf900000)
    space 1024K, 100% used space 1024K,   0% used F    1416 1416       [0xffffffff4cf00000, 0xffffffff4d000000, 0xffffffff4d000000)
 F space 1024K,   0% used [0xfffffffed8900000, 0xfffffffed8900000, 0xfffffffed8a00000)
 space 1024K,   0% used 1416          [0xffffffff2cd00000, 0xffffffff2cd00000, 0xffffffff2ce00000)
         space 1024K,   0% used    [0xffffffff23600000, 0xffffffff23600000, 0xffffffff23700000)
    83       F      [0xfffffffeaf900000, 0xfffffffeaf900000, 0xfffffffeafa00000)
 space 1024K, 100% used    749 1416       F    space 1024K, 100% used    [0xffffffff4d000000, 0xffffffff4d100000, 0xffffffff4d100000)
 F 1416 space 1024K,   0% used 1416 [0xffffffff2ce00000, 0xffffffff2cf00000, 0xffffffff2cf00000)
          space 1024K,   0% used       space 1024K,   0% used   [0xfffffffed8a00000, 0xfffffffed8a00000, 0xfffffffed8b00000)
    83      [0xffffffff23700000, 0xffffffff23700000, 0xffffffff23800000)
 93 [0xfffffffeafa00000, 0xfffffffeafa00000, 0xfffffffeafb00000)
 space 1024K, 100% used       space 1024K, 100% used               [0xffffffff4d100000, 0xffffffff4d200000, 0xffffffff4d200000)
    0 [0xffffffff2cf00000, 0xffffffff2d000000, 0xffffffff2d000000)
    F    F       space 1024K, 100% used       1416 1416        92 space 1024K,   0% used [0xfffffffed8b00000, 0xfffffffed8c00000, 0xfffffffed8c00000)
 83 space 1024K,   0% used space 1024K, 100% used    [0xfffffffeafb00000, 0xfffffffeafb00000, 0xfffffffeafc00000)
 space 1024K, 100% used    [0xffffffff2d000000, 0xffffffff2d100000, 0xffffffff2d100000)

Comments
EVALUATION http://hg.openjdk.java.net/jdk7/hotspot-gc/hotspot/rev/ff2402f6a50b
05-10-2009

SUGGESTED FIX The fix is to propagate that there has been a failure from the region verification code (which might be running in parallel) up to the top-level ::verify() method and do the heap dump, when required, in the ::verify method which is guaranteed to be executed single-threaded. The fix also contains a couple of very minor cosmetic improvements to the heap dump.
25-09-2009

WORK AROUND -XX:-GCParallelVerificationEnabled
16-09-2009

EVALUATION The way parallel heap verification was implemented was for each GC thread to claim a region and run verify on it. What seems to happen, however, is that if verification on a region fails, the thread that did the verification dumps per-region information for the entire heap. As a result, if two threads detected that verification fails, then they will dump the heap concurrently. Hence the messy output.
16-09-2009