This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Tomcat and the fly likes Tomcat hangs / locks up after container reload Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat hangs / locks up after container reload" Watch "Tomcat hangs / locks up after container reload" New topic
Author

Tomcat hangs / locks up after container reload

Erik Stackenland
Greenhorn

Joined: Apr 08, 2010
Posts: 3
I'm running Tomcat 6.0.18 on CentOS 5.3.

I have several host containers (virtual hosts) running.

Lately Tomcat have started to hang (stops answering requests) after reloading a host container, i.e. updating a jar in WEB-INF/lib and then running touch on web.xml.

It does not seem to matter which container I reload. The hanging occurs some time after the reload, two last times about 30 minutes after.

When doing a full restart it runs forever.

I have no idea where to start looking to solve this problem.

Any ideas?




Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

I would look at the perm-gen levels.

Unlike heap space the perm-gen space (which holds class definitions, final vars, and interned Strings) doesn't get cleared out when you reload an application. So, every time you reload, you're adding a new set of class defs to the the perm-gen space.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Kees Jan Koster
JavaMonitor Support
Rancher

Joined: Mar 31, 2009
Posts: 251
    
    5
Dear Erik,

Diagnosing a Tomcat that does not respond is tricky. The question you need to answer is this: "what are the threads doing, if they are not serving HTTP requests?" Here is some info to get you started with analysing thread dumps.

http://java-monitor.com/forum/showthread.php?t=616
http://java-monitor.com/forum/showthread.php?t=317

Kees Jan


Java-monitor, JVM monitoring made easy <- right here on Java Ranch
Erik Stackenland
Greenhorn

Joined: Apr 08, 2010
Posts: 3
Thanks for the tips, I'll check these and see if I can find anything.
Erik Stackenland
Greenhorn

Joined: Apr 08, 2010
Posts: 3
I did find something. When running jstack I had 40 HTTP threads that were all blocked on a synchronized method. However I could not find a race condition or similar that would explain it. I have rewritten the method to synchronize only the critical part of the code instead of the complete method, so I hope this helps.

Thanks again!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tomcat hangs / locks up after container reload
 
Similar Threads
Stopping or reloading application shuts down tomcat server
integrating servlet application into a website
JSTL does not compile
Avoiding context reload
Causing Tomcat to reload automatically after changes have been made server.xml