This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes Tomcat and the fly likes Have to restart Tomcat every 30 mins Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Have to restart Tomcat every 30 mins " Watch "Have to restart Tomcat every 30 mins " New topic

Have to restart Tomcat every 30 mins

Saumya Nair
Ranch Hand

Joined: Apr 25, 2006
Posts: 34
Hello all,

We have dan application in JSP which runs on Tomcat4.. Using jdk 1.4 version.... The application is being accessed by many users.. But recently it has been observed that it consumes a lot of memory & the server hangs..& hence we have to restart the server every 30 mins.. Can anybody please suggest what can be the possible cause & how to solve it...

[ July 21, 2006: Message edited by: Bear Bibeault ]
Jaikiran Pai

Joined: Jul 20, 2005
Posts: 10441

Can anybody please suggest what can be the possible cause

One way to figure out the reason why the server hangs, is to obtain a thread dump. You can do so by using 'Ctrl + Break' in Windows on the tomcat server console. Obtain the thread dump when the server hangs. The output will show the list of threads and the operations these threads are performing. You can then analyze the thread dump to get to know about the actual cause of the server hang
[ July 21, 2006: Message edited by: jaikiran pai ]

[My Blog] [JavaRanch Journal]
Murad Iqbal
Ranch Hand

Joined: Dec 09, 2003
Posts: 90
Ideally, get your application to generate logs and print meaningful messages in them. You can then trace what can then be the cause. You may want to try out Log4j.
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

Without access to your app, would be hard for folks on a forum such as this to give you much meaningful help.

I can say the primary culprit in these types of cases is a failure to close database connections or to return them to a connection pool if one is being used.

It is also often the case that an app just needs more memory than the 64k default alloted to a JVM. You may just need to increase the heap size when starting Tomcat.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Have to restart Tomcat every 30 mins
It's not a secret anymore!