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 use the HeapWalker to view the following information.
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.
Using the Tabs in the Heap Window
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 use the Static Fields and Classes tab to modify the information that is displayed in the tab.
You can click the Static Fields button at the top of the Classes tab to view the static fields of the selected class.
You can use the Class Name Filter to limit the classes that are displayed.
You can double-click any class in the 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.
If you click Compute retained size at the top of the Instances tab the IDE will
calculate and display the size of each instance and the total size for all the instances of the selected class.
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.