Java6 Heapdump
Java6 Heapdump
This presentation discusses the changes in how the virtual machine produces heap dumps
in the IBM SDK for Java Version 6.
Java6_Heapdump.ppt Page 1 of 11
IBM Software Group
Agenda
Heap dump overview
Change in default heap dump behavior
Heap dump compression and performance improvements
2
Heap dump changes © 2007 IBM Corporation
This presentation will start with a brief description of heap dumps and then discuss the
changes in heap dump behavior in the IBM SDK for Java Version 6, including the default
conditions for producing heap dumps, file compression, and performance improvements.
Java6_Heapdump.ppt Page 2 of 11
IBM Software Group
3
Heap dump changes © 2007 IBM Corporation
The term heap dump describes the IBM Virtual Machine for Java mechanism that
generates a dump of all the live objects that are on the Java heap; that is, those that are
being used by the running Java application. The heap dump file contains information
about all of the objects in the heap, including the identifying Java class for each object and
references to other objects in the heap and is produced when the Java heap is exhausted.
This dump is stored in a portable heap dump file, a compressed binary format, by default.
The text or classic heap dump is a list of all object instances in the heap, including object
type, size, and references between objects, in a human-readable format. It is in EBCDIC
on z/OS and in ASCII on all other platforms. Use the environment variable
IBM_JAVA_HEAPDUMP_TEXT=true to enable text heap dumps. You can use various
tools on the heap dump output to analyze the composition of the objects on the heap and,
for example, help to find the objects that are controlling large amounts of memory on the
Java heap and the reason why the garbage collector cannot collect them. The preferred
heap dump analysis tool, Memory Dump Diagnostic for Java, is available in IBM Support
Assistant.
Java6_Heapdump.ppt Page 3 of 11
IBM Software Group
-Xdump:heap:events=systhrow,
-Xdump:heap:events=systhrow,
filter=java/lang/OutOfMemoryError,
filter=java/lang/OutOfMemoryError,
label=C:\test\heapdump.%Y%m%d.%H%M%S.%pid.phd,
label=C:\test\heapdump.%Y%m%d.%H%M%S.%pid.phd,
...
...
4
Heap dump changes © 2007 IBM Corporation
In Version 5, heap dumps were produced by default for any uncaught OutOfMemoryError
event, including OutOfMemoryErrors produced in user code. The default behavior has
changed in Version 6, so that heap dumps are produced for OutOfMemoryErrors triggered
by the virtual machine. The new systhrow event has been added in this release to support
this new heap dump behavior. The example on the slide shows a portion of the default
dump agent configuration for heap dumps. You can see the default behavior for all of the
dump agents in your Java environment by running with the –Xdump:what command-line
parameter.
Java6_Heapdump.ppt Page 4 of 11
IBM Software Group
5
Heap dump changes © 2007 IBM Corporation
When moving from Version 1.4.2 to Version 5.0 of the SDK, some users experienced a
large increase in heap dump file size on 64-bit platforms. In Version 6, the Portable heap
dump file format has been updated to allow for more compression in binary heap dump
files. Many users may notice substantially smaller heap dump files when moving from the
Version 5.0 SDK to Version 6. While the underlying PHD format has changed, heap dump
processing tools like the Memory Dump Diagnostic for Java will continue to function as
expected.
Java6_Heapdump.ppt Page 5 of 11
IBM Software Group
6
Heap dump changes © 2007 IBM Corporation
In conjunction with the updates for compressed heap dump files, it is now also much faster
to write heap dumps to disk. Clearly, it will be faster to record smaller files in the file
system. In addition to the compression scheme, the SDK now incorporates a caching
mechanism for writing heap dump files so that the dump generator performs fewer native
file operations. Crossing over the boundary to write data out to a file is an expensive
operation, so this new caching scheme offers substantial performance improvements. In
some cases in Version 6, you will see that heap dumps are generated more than 10 times
as fast as similar heap dump files in the Java 5 SDK.
Java6_Heapdump.ppt Page 6 of 11
IBM Software Group
Section
7
Heap dump changes © 2007 IBM Corporation
Java6_Heapdump.ppt Page 7 of 11
IBM Software Group
Summary
Heap dumps contain information about the Java heap
Produced by the new systhrow trigger on
java/lang/OutOfMemoryError events
Heap dump compression and performance improvements
8
Heap dump changes © 2007 IBM Corporation
Heap dump files contain information about all of the objects in the Java heap. A new
dump trigger – systhrow – was introduced in this release to allow heap dumps to be
generated by default when the virtual machine triggers an OutOfMemoryError event.
Heap dump files are also smaller than in the previous release, and this compression and a
new caching scheme mean that the heap dump generator can produce heap dump files
faster.
Java6_Heapdump.ppt Page 8 of 11
IBM Software Group
References
Diagnostics guide
http://publib.boulder.ibm.com/infocenter/javasdk/v6r0/index.jsp
9
Heap dump changes © 2007 IBM Corporation
Java6_Heapdump.ppt Page 9 of 11
IBM Software Group
Feedback
Your feedback is valuable
You can help improve the quality of IBM Education Assistant content to better
meet your needs by providing feedback.
Did you find this module useful?
10
Heap dump changes © 2007 IBM Corporation
You can help improve the quality of IBM Education Assistant content by providing
feedback.
Java6_Heapdump.ppt Page 10 of 11
IBM Software Group
11
Heap dump changes © 2007 IBM Corporation
Java6_Heapdump.ppt Page 11 of 11