2 Minutes To Code (β Version)

Eclipse Memory Analyzer - 2 minute tutorial

Finding GC Root : How to find the reference chain of live java objects

The dominator tree view talks in terms of class names. However, if you need to know the field names or reference names that hold the biggest objects, you need to use the GC Root view.

Go to the Histogram view. Select a suspect item with inordinately high memory foot-print, right click on it and select Merge Shortest Paths To GC Roots > with all references.

In the image below, we have selected the GregorianCalendar objects. The next view that opens will show the reference chain. In the image below, it showed that the GregorianCalendar objects were stored in a CalendarStore object which is a thread (named Thread-0) in a HashMap field calMap.