I have a Java heap dump, and I would like to find out the size of the used heap and how much free memory was available. I'm using the Eclipse memory Analyzer. Is this possible?
Asked
Active
Viewed 406 times
2
-
possible duplicate of [Programmatically analyze java heap dump file](http://stackoverflow.com/questions/11127447/programmatically-analyze-java-heap-dump-file) – Santhosh Jan 19 '15 at 12:06
-
No, I'm looking for the equivalent of Runtime.freeMemory(). I don't see at all how the linked answer provides that. – Michael Böckling Jan 19 '15 at 12:11
1 Answers
0
I do not think the heap dump will have the information of the system free memory at the time the heap dump was created. A heap dump is a snapshot of all the objects in the Java Virtual Machine heap at a certain point in time. The JVM software allocates memory for objects from the heap for all class instances and arrays. The garbage collector reclaims the heap memory when an object is no longer needed and there are no references to the object. By examining the heap you can locate where objects are created and find the references to those objects in the source.

Keen Sage
- 1,899
- 5
- 26
- 44