In the graph, you can explore the incoming and outgoing references of the selected objects and find paths between objects or paths to garbage collector roots.
For classes there is a special condition that prevents garbage collection: Since each instance has an implicit reference to its class, any live instance prevents a class from being garbage collected. This construct groups all such instances for reasons of conciseness. In this way you can also select all instances of a specific class (rather than a specific class name).
A set of live instances that reference a yellow class object (see above) has a green background.
Classes (objects of java.lang.Class) have a yellow background.
In most circumstances, classes are the last step on the path to the GC root that you are interested in. Classes are not garbage collector roots, but in all situations where no custom classloaders are used it is appropriate and easier to treat them as such. This is JProfiler's default mode when searching for garbage collector roots, you can change this in the path to root options dialog.Class objects have references to
Note that class objects have no reference to their super class.
Classes are garbage collected together with their classloader when
By default, the reference graph only shows the direct incoming and outgoing references of the current instance. You can expand the graph by double clicking on any object. This will expand either the direct incoming or the outgoing references for that object, depending on the direction you're moving in. Selective actions for expanding the graph are available in the view-specific toolbar and the context menu:
If applicable, an instance has
plus signs at the left and the right side to show or hide
incoming and outgoing references. The controls at the left side are
for incoming, the controls at the right side for outgoing references. The plus signs have the same effect
as the Show outgoing references
and the
Show incoming references
actions. If there is no plus sign, all references have been expanded.
Each object is optionally annotated with an object ID. With this ID, you can check whether two objects are
the same or not. The display of IDs can be switched off the the context menu and the
view settings.
The graph may contain a number of unconnected branches.
To clean up the graph, select a node on the branch that should be retained and select the
remove unconnected items
action from the graph toolbar or the context menu.
To remove all objects from the graph to its original state, you can choose Clear graph from the context menu.
The reference graph offers a number of navigation and zoom options.
After the search has completed, the graph is expanded up to the garbage collector roots that were found. If the object is not referenced by a garbage collector root, a message box will be displayed. Note that this case is only possible if the "Remove unreferenced and weakly referenced objects" option in the heap walker option dialog is unchecked.
The garbage collector roots themselves are displayed with a red background.Any found path will be highlighted in red along the edges of the path. When you search for another path, the old highlighted path displayed in black again.
After your selection, the view helper dialog will assist you in choosing the appropriate view for the new object set.