Reputation: 1903
The application hitting slowness issue and generate some heapdump
file, the heapdump
file is 1.2GB, and I need to run my ha456.jar
using 8.4GB RAM only can open the heapdump.
Before this, when I analyze the heapdump
, I will try to see the Bigger LeakSize
and check for the Leak Suspect value, and I can see that which class or which method of my application holding the big memory. And then I will try to fix the code so that it can run with better performance.
For this time, I cant really get the point that which module/method of my application causing the out of memory issue. The following are some of my screen shot of my HeapAnalyzer
:
For me, its just common class, for example java/lang/object, java/lang/Long, or java/util/HashMap. I cant really know which method of my application causing the out of memory.
Appreciate your advise on how to analyze on this.
Upvotes: 1
Views: 1186
Reputation: 2157
Finding memory leak is always very difficult for anyone in front of the code, let alone from so far. So I can only give you some suggestions:
Upvotes: 2
Reputation: 2178
This maybe happening due to a lot of records are read from somewhere like database, queue which is of type Long. There could be a cartesian join or something of that sort. Once i had a ton of strings causing oom and the culprit was a logger accumulating logs.
A couple of thoughts- When you get oom error trace that back to the suspect method. Get thread dump and see which threads are active and what they are executing.
Upvotes: 0