Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse MAT doesn't show shallow/retained heap size

I'm trying to find a possible memory leak using the Eclipse Memory analyzer, but when I search for some objects, I cannot get the heap size for it and the columns "Shallow Heap/Retained Heap" are always empty.

enter image description here

When I right click on any object and do "Calculate Precise Retained Size", nothing happens. Is there something I need to run before I'm able to see some data? I see the retained heap size in histogram, but nowhere else(like in dominator tree).

like image 414
NeplatnyUdaj Avatar asked Feb 23 '15 17:02

NeplatnyUdaj


People also ask

How do I see heap memory in Eclipse?

Measuring the memory usage of eclipseGoto Window > Preferences > General and enable Show heap status and click OK.

What is the difference between shallow heap and retained heap?

Shallow heap is the memory consumed by one object. Retained set of X is the set of objects which would be removed by GC when X is garbage collected. Retained heap of X is the sum of shallow sizes of all objects in the retained set of X, i.e. memory kept alive by X.

What is shallow size and retained size?

shallow size: the size of the object itself. retained size: the size of the object itself, plus the size of other objects that are kept alive by this object.


1 Answers

I set preference → Memory Analyzer → Bytes Display to KB and it showed retained heap.

like image 90
anLA7856 Avatar answered Nov 27 '22 10:11

anLA7856