Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 6797870
Votes 0
Synopsis Add -XX:+{HeapDump,PrintClassHistogram}{Before,After}FullGC
Category hotspot:garbage_collector
Reported Against
Release Fixed hs15(b03), 7(b51) (Bug ID:2174464)
State 10-Fix Delivered, request for enhancement
Priority: 3-Medium
Related Bugs 6454676 , 6808808 , 6810861 , 6811367 , 6818264
Submit Date 26-JAN-2009
Description
Add a -XX:+HeapDumpBeforeFullGC that produces a heap dump when a full gc becomes necessary,
whether because of a promotion failure, concurrent mode failure, explicit request or other
reason.  The heap dump can then be analyzed to discover which objects/classes dominate the
set of live objects and thus provide clues to application developers about which objects
and classes to focus on so as to decrease or eliminate the chances of a full gc.  The
heap dump should not increase full gc time by more than 15%.  This is a somewhat vague
number since full gc time depends on things like the percentage of live data in the heap,
but it gives a sense of the tolerable overhead.
Posted Date : 2009-01-26 22:38:06.0

Modified synopsis from the original:-

  "Add -XX:+HeapDumpBeforeFullGC"



   " Add -XX:+{HeapDump,PrintClassHistogram}{Before,After}FullGC"

based on discussions (also with requesting customer).
Posted Date : 2009-02-23 18:46:28.0
Work Around
N/A
Evaluation
See suggested fix section; solution under test and review.
Posted Date : 2009-02-23 18:40:20.0

If the user specifies -XX:+ExplicitGCInvokesConcurrent* when using CMS, then the ensuing
GC upon a System.gc() invocation is usually a concurrent GC, rather than one of the
stop-world variety. In such cases, there are no dumps or histograms produced.
In other words, these dumps and/or histograms are produced only upon a major
stop-world gc.

Moreover, the 15% delta is being treated as advisorial in nature at the moment.
Clearly, with a heap dump it is nearly impossible to meet such a constraint
for general heaps; with a class histogram there is some chance of meeting that
constraint, but it is by no means certain that we shall be able to meet it
in a first writing without further optimization of the current histogram
collection code. However, it is true that with sufficient parallelization
of the histogram collection, it should be possible to make the histogram
collection quite efficient, but that is a separate performance RFE, not
the current feature RFE.
Posted Date : 2009-02-23 18:58:27.0

Will, like 6808808, need CCC approval before it becomes officially
supported. Will also need to be reviewed by the serviceability and
tools groups.
Posted Date : 2009-02-23 19:26:17.0

6797870: Add -XX:+{HeapDump,PrintClassHistogram}{Before,After}FullGC

webrev: http://analemma.sfbay.sun.com/net/spot/workspaces/ysr/dump/webrev/

This is an RFE request from a financial sector customer.
See description section of the CR for their request.
Above, "Full GC" is any stop-world major gc.

When HeapDump{Before,After}FullGC is specified you get
a heap dump prior to (respectively immediately
following) a full gc. The file name for the first
such dump follows exactly the rules used for other
HeapDump* flags. Subsequent dumps append a successor
ordinal number to the name used in the first dump.

When PrintClassHistogram{Before,After}FullGC is specified
you get a class histogram of the usual kind either just
prior to or immediately following a full gc. The data
is sent to the same stream to which PrintClassHistogram
data would have gone (usually gclog file if one was
specified, and otherwise to stdout).

All flags are "manageable" and can be dynamically toggled.

Although many files have been touched, the changes are few
and the main ones limited to two files.
A main technical change in the implementation was a
suitable modification of the relevant dumping/histogram
code so that it could be called directly from the VM
thread rather than as a VM operation. This allowed us
to precisely position the snapshot for example between
a failed scavenge because of promotion failure
and the full collection that we bail out to.

While in a strict technical sense this functionality cannot
be exactly simulated using a combination of existing
tools such as jmap -dump or jmap -histo[:live], in conjunction
with suitably placed Dtrace probes, a pretty close
approximation can indeed be achieved. Of course, these
flags allow such debugging on platforms that do not support
Dtrace. Also the customer requesting the RFE was adamant that
this functionality was needed by them.

A separate RFE is extending histogram presentations to
be relativized per generation and will be available for
review in the next day or two.

The code has been tested manually under a variety of
conditions, and is being tested/evaluated by the customer.

PS: <deleted>

PPS: The RFE will be extended to G1 under a separate CR.
Posted Date : 2009-02-27 19:35:21.0

http://hg.openjdk.java.net/jdk7/hotspot-gc/hotspot/rev/c6c601a0f2d6
Posted Date : 2009-03-03 03:20:29.0
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang