Allocation monitor view

## Allocation monitor view |
| up | next

| The allocation monitor view shows a top-down call tree cumulated for all threads and filtered according to the active filter sets which is similar to the one shown in the invocation view in JProfiler's CPU section except that it shows allocations of class instances and arrays instead of time measurements. The entries in the allocation tree have different meanings which are indicated by the displayed icons: leaf method where allocations were performed This points to an method where at least one allocation of a class instance or an array has taken place and no other unfiltered allocating methods were called. node method where allocations were performed This points to a method at least one allocation of a class instance or an array has taken place and other allocating methods were called. node method where no allocations were performed This points to a method where no allocation of a class instance or an array has taken place. However, there are other methods called from this method which perform allocations so this method must be shown to complete the tree up to the root. Every entry in the allocation tree has textual information attached which - depending on the allocation monitor view settings shows a percentage number which is calculated with respect to the root of the tree or calling method. a size measurement in bytes or kB which displays the shallow size of those objects which were allocated here (see below). an allocation count which shows how many instances of classes and arrays have been allocated here (see below). a 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 size and the allocation count are either cumulated for all method calls below the associated method or not, depending on the corresponding view setting. Note that allocations performed in calls to filtered classes are consolidated in the first method call into a filtered class.

| Only recorded objects will be displayed in this view. See the memory section overview for further details on allocation recording.

| By default, the allocation monitor displays allocations of all classes and array types. The allocation monitor 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 monitor to its default state of showing all allocations.

| The allocation 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 and allocation spot.

| You can stop and restart allocation recording to clear the allocation monitor and freeze all views to ensure that the allocation monitor remains static.