Java Platform, Standard Edition Troubleshooting Guide
Contents    Previous    Next

2.12 The jhat Utility

The jhat tool provides a convenient means to browse the object topology in a heap snapshot. This tool replaces the Heap Analysis Tool (HAT).

For more details on the jhat utility, see the jhat command man page.

The tool parses a heap dump in binary format (for example, a heap dump produced by jmap -dump).

This utility can help debug unintentional object retention. This term is used to describe an object that is no longer needed but is kept alive due to references through some path from the rootset. This can happen, for example, if an unintentional static reference to an object remains after the object is no longer needed, if an Observer or Listener fails to unregister itself from its subject when it is no longer needed, or if a Thread that refers to an object does not terminate when it should. Unintentional object retention is the Java language equivalent of a memory leak.

The following sections describe troubleshooting techniques for jhat utility.

2.12.2 Standard Queries

When you have connected to the jhat server, you can execute the following standard queries:

2.12.4 Heap Analysis Hints

To get useful information from jhat often requires some knowledge of the application and the libraries and APIs that it uses. You can use jhat to answer two important questions:

Contents    Previous    Next

Copyright © 1993, 2017, Oracle and/or its affiliates. All rights reserved.