while working on one the java email-messaging application, we encountered memory leak. following are some points to identify memory leak
1. On unix systems, use top command to check RSZ (residential memory) for particular java application
2. you can capture RSZ by creating scipts OR any resource utilization tool
- generally memory leak will get observed during long duration test.
- after long duration test, you can generate graph from captured resource utilization and verify for RSZ memory graph. If it shows linear graph,
then we can say its memory leak
What to check during heap dump analysis
- check leak suspect report in eclipse MAT
- In dominator tree, check classes and its instances,which having maximum retained heap. max retained heap instance causes memory leak
- Class Histogram shows the classes found in the snapshot, the number of objects for each class, the heap memory consumption of these objects, and the minimum retained size of the objects
- observe GC activity and its frequency.
How to solve memory leak problem.
As per my experience following points need to consider to get out of memory leak issue.
1. try increasing -Xmx in heap size ( its should be 70% of RAM)
2. take heap dump using jmap/jhap tool and analyse heap dump with JvisualVM/Eclipse MAT.
3. check GC frequency duration GC activity.
1. On unix systems, use top command to check RSZ (residential memory) for particular java application
2. you can capture RSZ by creating scipts OR any resource utilization tool
- generally memory leak will get observed during long duration test.
- after long duration test, you can generate graph from captured resource utilization and verify for RSZ memory graph. If it shows linear graph,
then we can say its memory leak
What to check during heap dump analysis
- check leak suspect report in eclipse MAT
- In dominator tree, check classes and its instances,which having maximum retained heap. max retained heap instance causes memory leak
- Class Histogram shows the classes found in the snapshot, the number of objects for each class, the heap memory consumption of these objects, and the minimum retained size of the objects
- observe GC activity and its frequency.
How to solve memory leak problem.
As per my experience following points need to consider to get out of memory leak issue.
1. try increasing -Xmx in heap size ( its should be 70% of RAM)
2. take heap dump using jmap/jhap tool and analyse heap dump with JvisualVM/Eclipse MAT.
3. check GC frequency duration GC activity.
No comments:
Post a Comment