Eclipse MAT Easy!
From my own experience, OutOfMemoryError are often due to a "Collection" instance retaining all objects in Java Heap. We all have our recipe to deal with OOME. Mine is quite simple, I get the dominator tree view, and I go down all the levels as long as the retained heap is high. And I often found an API Collection instance as java.util.List, java.util.Set or java.util.Map.
View uses default IClassSpecificNameResolver instances to display name as in the Dominator Tree. However "Collection" instances like java.util.List, java.util.Set or java.util.Map are displayed differently to show the refered field in the problematic class.
In example : You can see that field Collection values in class com.github.qlefevre.eclipse.mat.test.heapdump.BagB retains 37.81% of total heap. Instance java.util.HashSet has 63404 elements and retains 8.24 MB.
Note for Memory Analyzer 1.7.0: you must disable "Eclipse Oxygen" update site before installing plugins otherwise your MAT installation will get broken.
To disable Eclipse Oxygen in MAT 1.7.0, perform the following:
- Open MAT Settings
Available Software Sites
Use the following update repository to install the latest released version: http://github.com/qlefevre/eclipse-mat-easy/raw/master/com.github.qlefevre.eclipse.mat.easy.updatesite
To install Eclipse MAT Easy plugin, perform the following:
Install New Software...
- For MAT 1.7.0: in case you have not disabled Eclipse Oxygen update site, click
Available Software Sitesand disable Oxygen there
Add, it will open a
Eclipse MAT Easy update siteto the
- All the checkboxes can be left by default (
Show only latest version,
Group items by category, ...)
Eclipse MAT Easy !category
- Accept License
Finishand restart MAT
The following update site can be used to get development builds: http://github.com/qlefevre/eclipse-mat-easy/raw/master/com.github.qlefevre.eclipse.mat.easy.updatesite