United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6890137 G1: revamp reachable object dump
JDK-6890137 : G1: revamp reachable object dump

Details
Type:
Enhancement
Submit Date:
2009-10-09
Status:
Closed
Updated Date:
2011-03-08
Project Name:
JDK
Resolved Date:
2011-03-08
Component:
hotspot
OS:
generic
Sub-Component:
gc
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
hs17
Fixed Versions:
hs17 (b05)

Related Reports
Backport:
Backport:
Backport:
Backport:
Relates:
Relates:

Sub Tasks

Description
In G1 we have a facility to dump (to standard output or to a file) the objects that are considered reachable (either above TAMS, or marked explicitly). Currently, this is used to optionally dump the live objects when heap verification fails and it was very helpful when debugging the marking bug in CR 6847956. 

This CR revamps this facility in a few ways:

- The current version only uses the "previous" marking information to determine whether an object is live or not. This was acceptable before, as we only did heap verification based on the "previous" marking information. However, CR 6850846 extended heap verification to also used the "next" marking information when necessary (in particular: at the end of remark). So, it is helpful to extend the reachable object dump to be able to use either the "previous" or "next" marking information as necessary. The method is renamed to the more reasonable print_reachable().

- Change print_reachable() to only dump to files and never on tty / gclog_or_tty. The dumps tend to be quite large, even for small-ish heaps, so it's counter productive to do them on tty. There might be several places where we call print_reachble() during a marking cycle (we currently have two, see below). The output files would have the same prefix and a suffix that depends on the point when they were taken (see below).

- There is currently an ad-hoc facility that dumps the reachble objects at the initial mark pause. This is very helpful in order to compare what was reachable at the beginning of the marking cycle with what is reachable at the end of the marking cycle (typically: when verification failed). However, it's best to remove the ad-hoc code in favor of re-using print_reachable().

- Three developer arguments drive print_reachable()
   * G1PrintReachableBaseFile : The base file name for the heap dump file. A suffix will be appended to that depending from where print_reachable() was called.
   * G1PrintReachableAtInitialMark : It dumps the reachable objects at initial mark. The suffix for these files is ".before".
   * G1VerifyDuringGCPrintReachable : It dumps the reachable objects when heap verification fails. The suffix for these files is ".failed-verification'.

- Exclude the reachable object dump code from product builds, as the arguments that enable it are developer arguments.

                                    

Comments
EVALUATION

See Description.
                                     
2009-10-09
EVALUATION

http://hg.openjdk.java.net/jdk7/hotspot-gc/hotspot/rev/6270f80a7331
                                     
2009-10-23
EVALUATION

http://hg.openjdk.java.net/hsx/hsx16/baseline/rev/2572dd3d6d7c
                                     
2009-11-12
EVALUATION

http://hg.openjdk.java.net/hsx/hsx16/master/rev/2572dd3d6d7c
                                     
2009-11-13



Hardware and Software, Engineered to Work Together