United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6882730 G1: parallel heap verification messes up region dump
JDK-6882730 : G1: parallel heap verification messes up region dump

Details
Type:
Bug
Submit Date:
2009-09-16
Status:
Resolved
Updated Date:
2011-12-22
Project Name:
JDK
Resolved Date:
2009-11-11
Component:
hotspot
OS:
generic
Sub-Component:
gc
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
hs17
Fixed Versions:
hs17 (b04)

Related Reports
Backport:
Backport:
Backport:
Relates:

Sub Tasks

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
WORK AROUND

-XX:-GCParallelVerificationEnabled
                                     
2009-09-16
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.
                                     
2009-09-16
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.
                                     
2009-09-25
EVALUATION

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



Hardware and Software, Engineered to Work Together