Heap Walker - Classes


  The heap walker classes view conforms to the basic layout of all heap walker views. Also see the help on key concepts for the entire heap walker.
  The functionality of the classes view is identical to that of the all objects view and the recorded objects view except that it is static with respect to the current snapshot and only instances of classes and arrays in the current object set are shown.

If you have multiple classes with the same name from different classloaders and want to differentiate between those classes, you have to navigate to a specific instance, go to the references view of the heap walker and continue with the class selection as described there.

No specific view settings apply to the classes view.

  The classes view has an aggregation level selector. It allows you to switch between
  • Classes
    Every row in the table is a single class. This is the default aggregation level.
  • Packages
    Every row in the table is a single package. Sub-packages are not included. In this aggregation level, the table becomes a tree table. You can open each package by clicking on the tree node on its left and see the contained classes directly beneath it.
  • Java EE components
    Every row in the table is a Java EE component. This aggregation level is like a filter for the classes mode and enables you to quickly check the loaded Java EE components in your profiled application.
  There are three sortable columns shown in the table:
  • Name
    Depending on the aggregation level, this column shows different values:
    • classes
      shows the name of the class or the array type.
    • package
      shows the name of the package.
    • Java EE
      shows the display name of the Java EE component. If the display name is different from the actual class name, the class name is displayed in square brackets.
  • Instance count
    Shows how many instances are currently allocated on the heap. This instance count is displayed graphically as well.
  • Size
    Shows the total size of all allocated instances. Note that this is the shallow size which does not include the size of referenced arrays and instances but only the size of the corresponding pointers. The size is in bytes and includes only the object data, it does not include internal JVM structures for the class, nor does it include class data or local variables.
  By default, the classes view only shows the shallow size of the selected objects for each class. To calculate the retained size on a per-class basis, click on the "Calculate estimated retained sizes" link above the table. A new column for the retained sizes will be added.

Apart from the values for primitive arrays, all retained sizes are lower bounds. The algorithm is much faster than for a precise calculation and good enough in most cases. If you need the exact retained size on a per-class basis, make a new object set with the class of interest and click on the "Calculate retained and deep sizes" link in the object set description at the top.

  To add a selection step from this view you can select one or multiple rows from the table and click on the [Use ...] button above the table. In the drop-down menu you can decide whether to use the
  • Selected instances
    The new object set will consist of all objects of the selected classes. For a single class, you can also double-click on a row in the table.
  • Selected java.lang.Class objects
    The new object set will consist of all java.lang.Class objects of the selected classes.
  • Retained objects
    The new object set will consist of all objects that are retained by the current object set. Retained objects are all objects that would be garbage collected if the entire current object set would be removed from memory. This always includes the current object set itself.
After your selection, the view helper dialog will assist you in choosing the appropriate view for the new object set.
  Next to the [Use ...] button, a button [Group by Class Loaders] is shown. This button invokes the group by class loaders inspection and is just a convenience that emphasizes the importance of that inspection for solving class loader memory leaks.

After the inspection completes, the classes view will be shown again, with a class loader grouping at the top. You can select each class loader and see the loaded classes immediately in the classes table. By right-clicking a class loader row, you can select the class loader object and create a new object set with it.