Class monitor view

  
  up next 


  The class monitor view shows the list of all loaded classes and arrays types together with the number of instances which are allocated on the heap. There are three columns shown in the table, which can be sorted.
  • Name
    Shows the name of the class or the array type. The notation <class>[] stands for non-primitive arrays of any class type. (e.g. the array might be of type String[] or Object[]). A further distinction is not possible due to the nature of Java bytecode.
  • 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.
  Only recorded objects will be displayed in this view. See the memory section overview for further details on allocation recording.
  By marking the current state, you can follow the evolution of the heap. Marking the current values can be achieved by
  • choosing Edit->Mark current values from JProfiler's main menu
  • choosing the corresponding toolbar entry
  • choosing Mark current values from the context menu
Upon marking, a fourth column labeled Difference appears with all values initially set to zero. With each subsequent update, the column's values track the difference of the instance count with respect to the point in time where the mark was set. The graphical representation of the instance count column shows the marked state in green and positive differences in red.

By default, the difference column is sorted on the absolute values in it, this can be changed in the class monitor view settings dialog.

You can remove the mark by

  • choosing Edit->Remove mark from JProfiler's main menu
  • choosing Remove mark from the context menu
  The class monitor can filter objects according to their liveness status:
  • Live objects
    Only objects which are currently in memory are shown.
  • Garbage collected objects
    Only objects which have been garbage collected are shown.
  • Live and garbage collected objects
    All created objects are shown.
To switch between the three modes, you can click on the toolbar entry displaying the current mode and chose the new desired mode. Also, JProfiler's main menu and the context menu allow the adjustment of the view mode via Edit->Change view mode.

If the garbage collected objects are shown, you can reset the accumulated data by clicking on the reset action in the toolbar or choosing the the Reset garbage collector for this view menu item in the Edit or context menu. All garbage collector data will be cleared and the view will be empty for the "Garbage collected objects" mode until further objects are garbage collected. Note that you can force garbage collection by clicking on the garbage collector  tool bar button or by selecting Profiler->Run garbage collector from JProfiler's main menu.

  The Edit->Take heap snapshot for selection menu item and the corresponding toolbar entry take a new snapshot, switch to the heap walker view and create an object set with the currently selected class.
  The update frequency for the class monitor can be set on the miscellaneous tab in the profiling settings dialog.
  You can stop and restart allocation recording to clear the class monitor and freeze all views to ensure that the class monitor remains static.