Client - Object Graph


Heapster Client - Object Graph

********** WARNING!********** WARNING!********** WARNING!**********

This feature is a failed experiment and is almost certainly not suitable for any projects that use application servers. This feature captures meta-data from the host JVM's object graph. Unfortunately, this requires a similar amount of heap as the graph itself. Please use at your own risk.

********** WARNING!********** WARNING!********** WARNING!**********

The third toolbar button from the left will produce an object graph of all reachable objects in memory. Extracting this data and processing it is a heavy-weight operation and may have an impact on the host JVM. You should also note that the host JVM is not paused during this operation. Fortunately, this is mostly inconsequential for the analysis of memory leaks as leaked objects ought to remain in memory regardless of on-going JVM operations. Clicking the Object Graph button (assuming we are using the LeakTester JVM as discussed on the previous page) will create a new Object Graph tab and produce a graph similar to the following:

The initial object graph table shows data based on the leak candidates. It ranks all the leak candidates by object type based on the likelihood that they are leaky and provides a count of each object type. The Object Graph tab has much other function, modeled after the Eclipse-based project Memory Analysis Tool (MAT). You will notice that a secondary toolbar inside the Object Graph table, which contains a single button. This is the Histogram button. It will produce a table with columns Type, Object Count, Shallow Heap, and Retained Heap. Each column is sortable. Here is a screen shot:

The Object Graph tab has other functionality similar to MAT. Specifically, it has a context menu (accessible through the menu bar's Graph menu or more conveniently, via a right-click pop-up menu.):

Here we have the following menus and menu items:

These features are mostly the same as MAT and probably don't require much explanation. However, here are some screen shots of each feature, which should be mostly self-explanatory.

List Objects -> with outgoing links

This is the outgoing links of the ca.discotek.testheapster.LeakTester row of the histogram. If the ca.discotek.testheapster.LeakTester node is expanded and we scroll down to click on the leakList field, the left-hand pane displays the Type, Name, and Value of the leakList fields.

List Objects -> with incoming links

The incoming links functionality is similar to that of outgoing links excepts it shows the references coming into the selected objects.

Path to GC Roots

Merge Shortest Paths to GC Roots

Retained Set


The Search interface does warrant some explanation. MAT uses an Object Query Language (OQL), which allows users to query the object graph. It has special syntax which provides fine-grained queries. Heapster does not provide an OQL interface. Instead it offers a simpler, yet effective alternative. You can create your own query based on object types and object names. By clicking the Add button, you will see the following dialog:

This dialog allows you to edit a single search term. The search term will operate on either a Class Name or the toString() result of an Object Value. The types of comparison operations can be either:

The Negation checkbox allows you to negate the term. For instance, if you selected Starts With and Negatation, the query "discotek" would return all values which do not start with "discotek".

Lastly, the expression field is where you enter the expression to match. If you entered a search term from the Negation example just above and clicked Okay, it would result in with the following:

You should note the radio buttons at the top left which allow you to choose either to match At least one term or All terms. Here is a screen shot of the result:

You should note that you can use the context popup menu on the search results to look at incoming/outgoing links, paths to GC roots, etc.


Client - Object Graph

Client - Object Graph