cancel
Showing results for 
Search instead for 
Did you mean: 

Heap Size vs. Heap Dump Size

Former Member
0 Kudos

Hi there,

I'm a new user of the MAT. Took my first steps in analyzing heaps yesterday, and so far the tool has been working great. Thank you so much for it!

After playing around with a "test heap", we tried to dump the heap of a longer running application server yesterday. This failed due to excessive disk usage. We have about 7GB left on the device - the heap is setup with a max of 1GB (-Xmx1024m). This was tried on Solaris with a 1.5.0_09 JVM from SUN.

During the creation of the "test heaps" I already noticed that the file size of the dumps do not correlate with the reported heap usage. Example: I have a Heap File from a freshly started Tomcat instance. The overall heap usage reported by MAT is about 3MB, but the heap file is 100MB. Another dump from a similar system (a cloned cluster partner of the system mentioned before) has a reported heap usage of 32,6MB with a filesize of about 138MB.

So I'm wondering: What sizes can I expected when dumping a large heap? Naturally I would expect the file to be as large as the utilization of the memory areas as jstat reports them, plus an additional overhead for "whatever" (maybe meta-data for the dump itself, or something). Is it realistic that a 1GB heap (utilization unknown) creates a heapdump of more than 7GBs?

I know that this is not a real question about the tool itself but jmap, and could be considered offtopic. But I've spent half a day looking for any specifics on this on the net without success. And to me this place seems to be the place where most of the knowledge can be found right now.

Anyway, thanks for reading this, and maybe providing any insights.

bye, Michael

Accepted Solutions (1)

Accepted Solutions (1)

former_member197208
Participant
0 Kudos

Hi Michael,

we expect a difference between the file size of the HPROF file and the heap space reported by the Memory Analyzer. HPROF is not a 1:1 image of the memory but defines a certain format for a class and object instances and arrays. Also, we remove some objects from the object graph because the heap dump can contain garbage even though a full garbage collection is run before the heap dump is written (for example, the GC is creation dump int[] to avoid moving objects which in turn means re-assigning addresses).

Having said this, it is definitely unhealthy that you find only 3 MByte with a heap file of 100MB. Would it be possible to take a look a the heap dump? Can you contact me at andreas dot buchen at sap dot com? It looks rather like a bug. We had to re-implement some stuff before open sourcing...

Andreas.

Former Member
0 Kudos

Hi Andreas,

I will send you an email shortly which will include the URL from which you can download the heap in question.

bye, Michael

Answers (0)