Using the Difference Column in the Memory Views



1. Introduction

In contrast to allocation recording, where you can restrict the displayed objects to a certain period of time, a common situation is that you want to retain all recorded objects but still see the difference of object allocations with respect to a certain point in time. In particular, you might be interested in which classes have a decreasing allocation count, something that would not be possible with allocation recording.

2. Memory views with differencing

By default the difference column is not displayed. Only when you choose View->Mark current values or the corresponding toolbar button, the difference column is shown as the last column. The following views in JProfiler have an optional difference column:

In most cases you'll be interested in sorting the view by the values in the difference column. There are two sort modes that can be adjusted in the view settings dialog:

3. Differencing and the heap walker

The difference column only shows a calculation, there's no fixed set of objects behind this number. Because of that, it is not possible to select the "difference objects" and work with them in the heap walker. To select objects based on their time of creation, please see the article on allocation recording.

4. The class tracker

The class tracker view provides a way to capture the history of instance counts over time for selected classes or packages in the form or a graph. However, you have to select the tracked classes or packaged in advance, so the class tracker is best used on classes or packages that appear suspicious from the differencing in the all objects or recorded objects views.