A captures profiling data at a specific point in time.
You can load and browse any heap dump saved on your local system.
You do not need to be running a profiling session to load and browse a heap dump.
Choose Profile > Load Heap Dump in the main menu.
Locate the heap dump on your system and click Open.
When you load a heap dump, the heap dump opens in the HeapWalker in the Heap window.
The default location for heap dump files
(the file name is appended with .hprof) that you save to your project
is in the <PROJECT_ROOTDIR>/nbproject/private/profiler folder.
The HeapWalker enables you to evaluate Java heap contents and search for memory leaks.
You can view the following:
List of classes present on the heap. For each class you can see the number of instances of that class and total size of all instances.
List of instances of each class. You can see individual instances and their size (size of instances of the same class varies only for arrays).
Fields of each instance or class. You can browse (static) fields to identify individual instances by field values and determine dependencies among them.
References to each instance. You can browse instances or classes holding reference to a particular instance to find unnecessary references and discover memory leaks.
Browse Heap Dump
When the heap dump is loaded and open in the Heap window, use the following tabs to view information about the heap dump:
Summary. This tab displays general information about the heap dump such as total numbers of classes, instances.
The Summary tab also provides you with information about the environment and system properties of the machine where the heap dump was taken.
Classes. This tab displays a list of classes with information about the number of instances of the class and total size of the instances.
You can also open the Static Fields browser to browse the static fields of each class.
To open the Static Fields browser, click the Static Fields button in the HeapWalker toolbar.
You can double-click any class in the classes list to view the instances of that class in the Instances tab.
Alternatively, you can right-click a class and choose Show in Instances View.
Instances. This tab displays the instances for a class that you select in the Classes tab.
For each instance, you can do the following:
Select an instance to browse the fields of the instance in the the Field Browser.
Select an instance to browse the references to the instance in the Reference Browser.
You can hide or reveal the individual windows by using the Instances button, the Fields button and
the References button in the toolbar.
OQL Console. This tab displays the OQL editor, saved OQL queries and a window
that displays the query results.
You can use any of the sample OQL queries or create a query to filter and select heap data to
locate the information that you want from the Java heap.
After you choose or write a query, you can run the query against the Java heap and view the results.
Comparing Heap Dumps
You can compare two heap dumps to view the differences between the the heap at two different points in time.
You do not need to be running a profiling session to compare heap dumps.
If no heap dump is open in the Heap window,
choose Profile > Load Heap Dump to open a heap dump.
Click the Classes tab in the Heap window.
Click Compare with another heap dump at the top of the Classes tab.
The IDE opens the Select Heap Dump to Compare dialog box.
Select a heap dump that is saved in your project or select From file and
click Browse to locate a heap dump that is saved outside of your project on your local system.
Click OK.
When you click OK, the IDE will update the Heap window to display the
differences between the two heap dumps.
You can click reset view to display the initial heap dump.