Hello,
I am new to Eclipse MAT. I opened a heap dump and saw this message in the log:
Removed 1,592,839 unreachable objects using 679,092,640 bytes
Does this mean there were these many objects that could be garbage collected but were not?
To provide context I am trying to debug the following problem: I have an application. When run on a problem of size N I am seeing following memory usage:
| N | memory |
| --- | --- |
| 1M | 1GB |
| 10M | 10GB |
| 20M | 100+GB |
As you can see the memory increases linearly from 1M to 10M but after that it increases very rapidly and exponentially which is unexpected (the problem). I have analyzed my code and memory allocation is proportional to N. My application is storing data in HashMap(s) for the most part. The only reason I can think of is that memory is not getting garbage collected. Is that hypothesis confirmed by this messageĀ in the log? (The log is shown for N=1M btw)
In the end, How can I fix this problem? How to make JVM collect unused objects? I am using the default GC.
I am really at my wits end trying to debug this and would appreciate any help.
S.