Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unit of retained heap in eclipse?

I am getting numeric value of 1294736 in 'retained Heap' column when I use Memory Analyzer in Eclipse-Helios, what is the unit of this numeric value ? is it bytes or kBytes?

Same query for shallow heap value.

like image 689
Just_another_developer Avatar asked May 17 '13 12:05

Just_another_developer


People also ask

What is shallow heap vs 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.

How do I use heap analyzer in Eclipse?

Use the Eclipse Memory Analyzer You may need to refresh your project (F5 on the project). Double-click the file and select the Leak Suspects Report. The overview page allows you to start the analysis of the heap dump. The dominator tree gives quickly an overview of the used objects.

How do you Analyse a heap dump?

Eclipse Memory Analyzer Tool ( MAT ) is used for analyzing heap dump files which contain objects in memory. Each heap dump file can be thought of as a snapshot in time and details the memory occupied by specific JVM threads.

How do I open a heap dump in eclipse?

Open Eclipse MAT To open the heapdump, go to File > Open Heap Dump (Not Acquire Heap Dump) and browse to your heapdump location.


1 Answers

I had the same question. It seems to be in bytes. You can confirm this by writing a simple java program that repeated add stuff to a list, then run it with "java -Xmx2m -XX:+HeapDumpOnOutOfMemoryError" to max its heap usage to 2M, and dump the heap when it becomes full, then load the hprof file into the tool to verify.

like image 194
HaiXin Tie Avatar answered Sep 28 '22 20:09

HaiXin Tie