Eclipse MAT: Shallow Heap Vs. Retained Heap

Eclipse MAT (Memory Analyzer Tool) is a powerful tool to analyze heap dumps. It comes quite handy when you are trying to debug memory related problems. In Eclipse MAT, two types of object sizes are reported:

  1. Shallow Heap
  2. Retained Heap

In this article, let's study the difference between them and explore how they are calculated