Exploring Memory Analysis Views > Exploring the Instance Detail View >  Calculating Memory Used by an Instance  

Calculating Memory Used by an Instance

You can calculate how much memory is consumed by an instance and its reference and referrer trees (Cumulative Size), as well as how much memory would be released by removing an object from the heap (Keep Alive Size).

When interpreting the values, you should be aware that they include recursive references. Multiple references to an object are only counted once. Recursive referrers are detected and only contribute their size to the total once.

Note If you remove an instance, you only free the Keep Alive Size, not the Cumulative Size.

After you calculate the memory used by an instance, the value is saved temporarily.

To calculate memory consumed and kept alive by an instance:

• In the Instance Detail view, right-click the instance and select Calculate Cumulative/Keep Alive Sizes.

Values appear in the Cumulative and Keep Alive columns for that instance.

The value in the Cumulative column represents the memory used by the instance and its reference tree (including any hidden instances). The value in the Keep Alive column represents the amount of memory that would be released if the instance is removed from the heap.