I have problem and don’t know how to get some clues on what might be wrong. I deployed my web application (spring – hibernate – MySQL) and for few seconds after it starts it works fine. I can browse the pages. Than all the requests get stack and nothing is loading. All pages are just hanging. The PageNotFound 404 error comes up when I put in wrong page.
The question is I have tomcat7.exe in active processes with memory slightly increasing over time. So I’m suspecting memory leak. How do I go about getting the memory heap from tomcat? And what heap analyzer would be best for finding out the leak?
PS: It turned out to be maxPoolSize was only 15 in ComboPooledDataSource. Increased it to 200 and everything works fine now.
A thread dump is what’s needed here. It will give you the insight you need into what the Tomcat processor (TP) threads are doing and also the heap statistics (assuming a recent Sun JVM). Unless you’re seeing high CPU utilisation in tandem with the memory growth up to the maximum configured heap size, then a memory leak is likely not your problem.
It’s more likely a condition blocking the threads and preventing the requests from completing, perhaps a common resource like a connection pool, etc. Using a thread dump analysis application will help if you’re not familiar with reading thread dump output. You might also consider enabling the Tomcat manager app, it provides some useful state information (much like Apache server-status) and use jconsole to monitor the JVM via JMX.