A Memory Leak happens when an application unintentionally holds on to object references that are no longer required. These unintentional object references prevent the built-in garbage collection mechanism from freeing up the memory consumed by these objects.

Pre-Requisite

Select Target

Memory Leak Analyzer

In the memory leak analyzer window, you can see the following information which are listed below:

Settings

In settings, you can apply the following two settings which are listed below:

Global Action Icons

Tabular View

Under the tabular view, you will be able to see a detailed list of all the objects currently consuming the memory on the selected instance. This is an extremely useful view in terms of identifying areas of optimization. Following details are provided for each object under the tabular view:

Global Action Icon

Chart View:

The chart view displays a pie chart showing distribution of the top 10 objects in terms of heap usage. For e.g. object type “byte[]” taking 20% of heap memory, object type “org.jruby.RubyString” taking 5.8% of heap memory etc.

Compare:

Under the compare section, you will be able to view the heap memory percentage taken by different object types. You can define the no.of samples you want to take for comparison and the sample interval count in seconds under the settings section.

For e.g. if you enter 2 under no.of samples and 60 seconds under the sample interval count then 2 samples will be taken after 60 seconds and you will be able to view the comparison in form of a bar chart with different colored bars coming for the two different samples as defined above.