Allocation hot spots view

  
  up next 


  The allocation hot spots view shows a list of methods where objects of a selected class have been allocated. Only methods are included which contribute at least 0.1% of the total number of allocations. The methods are filtered according to the active filter sets. This view is similar to the hot spots view in JProfiler's CPU section except that it shows allocations of class instances and arrays instead of time measurements.

Note: The notion of a hot spot is relative. Hot spots depend on the filter sets that you have enabled on the call tree collection tab of the profiling settings dialog. Filtered methods are opaque, in the sense that they include allocations performed in calls into other filtered methods. If you change your filter sets you're likely to get different hot spots since you are changing your point of view. Please see the help topic on hotspots and filters for a detailed discussion.

  Every hot spot is described in several columns:
  • the method name
  • the percentage of all allocations together with a bar whose length is proportional to this value.
  • the number of allocations.

The hot spot list can be sorted on all columns.

If you click on the  handle on the left side of a hot spot, a tree of backtraces will be shown. Every entry in the backtrace tree has textual information attached to it which depends on the allocation hot spots view settings.

  • the percentage of all allocations. This value is calculated with respect either to the parent hot spot or the called method. The percentage base can be changed in the allocation hot spots view settings.
  • the number of allocations that are contributed to the hot spot along this call path.

    Note: This is not the number of allocations in this method.

  • the method name which is fully qualified or relative with respect to to the calling method.
  • a line number which is only displayed if line number resolution has been enabled in the profiling settings and if the calling class is unfiltered. Note that the line number shows the line number of the invocation and not of the method itself.
  The combo box at the top-right corner of the view allows you to treat allocations of filtered classes in two different ways:
  • show separately
    Filtered classes can be hotspots of their own. This is the default mode.
  • add to calling class
    Allocations of filtered classes are always added to the calling class. In this mode, a filtered class cannot be a hotspot, except if it is a top-level upward filter bag, i.e. if it is not called by any unfiltered class, but calls unfiltered classes itself.
With these two modes you can change your viewpoint and the definition of a hotspot. Please see the help topic on hotspots and filters for a detailed discussion of this topic.
  By marking the current state, you can follow the evolution of the allocation hotspots. This is particularly useful for quickly finding the origin of memory leaks. 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 allocation count with respect to the point in time where the mark was set. The graphical representation of the percentage 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 allocation hot spots 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
  When navigating through the hot spots backtraces tree by opening method calls, JProfiler automatically expands methods which are only called by one other method themselves. To quickly expand larger portions of the hot spots backtraces tree, select a method and choose Edit->Expand 10 levels from the main window's menu or choose the corresponding menu item from the context menu. If you want to collapse an opened part of the hot spots backtraces tree, select the topmost method that should remain visible and choose Edit->Collapse all from the main window's menu or the context menu.
  Only recorded objects will be displayed in this view. See the memory section overview for further details on allocation recording.
  By default, the allocation hot spots displays allocations of all classes and array types. The allocation hot spots view can display allocations for a selected class, package or array type if class resolved allocations are enabled in the "Allocation monitor" section on the features tab of the profiling settings dialog.

The header above the tree view shows the current selection, the [Change selection] button brings up the package selection dialog. If class-resolved allocations are not enabled, a corresponding message is displayed instead of the package selection dialog. Note that you can still get class-resolved allocations in the heap walker unless the allocation monitor has been completely disabled.

The [Show all] button clears the selection and reverts the allocation hot spots view to its default state of showing all allocations.

  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 and allocation hot spot.
  You can stop and restart allocation recording to clear the allocation hot spots view and freeze all views to ensure that the allocation hot spots view remains static.