File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes Tomcat Shutdown Issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat Shutdown Issue" Watch "Tomcat Shutdown Issue" New topic

Tomcat Shutdown Issue

Narasimha Swami

Joined: May 27, 2008
Posts: 17
Hi Guys,

I have an issue with multiple tomcat instances' processes hanging over even on shutdown. I have fairly different configs for both the instances. But when I shutdown either of them sometimes one or other instance hangs over, which is not completely shutdown, they (hanged processes) just keep clogging up like this for a time. In some bad time they would have consumes all of the heap and I have no room to stop and start the instance. I have to issue manual kill for all the processes. I know there are several reasons for this happening can some one tell the few of them so that I can figure out and fix this bug. Although Tcat seems to be an fair option, but I am looking for a quick fix for now. Thank in advance.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17423

You're better off asking this where the Tomcat experts hang out - in the Tomcat forum. I'll move this thread over there.

Tomcat itself doesn't have any shutdown problems that I know of. However, if even a single user application thread refuses to terminate itself when requested, that thread can hold the entire Tomcat server hostage, since until all threads are terminated, the JVM cannot terminate itself.

So you need to look at your applications.

An IDE is no substitute for an Intelligent Developer.
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
I used the Tomcat Management app to detect some long-running request Threads that never terminated.

Working backward from that information I found Threads waiting for a resource that no-longer existed.

Narasimha Swami

Joined: May 27, 2008
Posts: 17
Ya I found it out as soon as I posted the question. I have the app deployed in the tomcat instance which starts lots of threads. May be these threads have to be turned down. For now I just placed an small code snippet in start/stop init script to notify me if tomcat has not properly shut down. So that I can bring it down using kill command. Although forcing kill on the process is a bad idea.
I agree. Here's the link:
subject: Tomcat Shutdown Issue
It's not a secret anymore!