简体   繁体   中英

how can i find which application is causing memory leaks

I am running Tomcat-6.0.32 on the RHEL 5.4 with JDK-1.6.0_23 version. I am running almost more than 15 applications. Applications are small applications only. My RAM is 8GB and swap is 12GB. I set the heap size from 512Mb to 4GB.

The issue is after a few hours or days of running, the tomcat is not providing service though it is up and running. While I could see the catalina.out log file, it is showing memory leak problem.

Now, my concern is I need to show a solution to that issue or at least I need to highlight the application which is causing the memory leaks.

Could anyone explain how I can discover which application is causing the memory leak issue?

One option is to use heap dumps (see How to get a thread and heap dump of a Java process on Windows that's not running in a console ) and analyze heap dump later on.

Or another option is to analyse process directly using tools like jmap, VisualVM and similar.

You may use the combination of jmap/jhat tools (Both these are unsupported as of Java 8) to gather the heap dump (using mmap) and identify the top objects in heap (using jhat). Try to co-relate these objects with the application and identify the rogue one.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM