• Post Reply Bookmark Topic Watch Topic
  • New Topic

System get Hanged while My application running on Tomcat server  RSS feed

 
sadhu charan
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi every body,

My web application on production server where i install tomcat 7, My web application(in JSP) running sucessfully still 12-16 hours, after that production server(means system)get Halt ; So application get stop, If i want to start my web application then i have reboot the system, Otherwise it will not work but tomcat server showing running. But Application not working at that time;

My web application contain 50 to 60 ajax timer where i check all the Pinging status of IP, and also check status of some windows services, and my application uses 20 threads,
What is the problem i am not get yet, but application working for only 12-16 hours


Thanks in Advance
SP

 
E Armitage
Rancher
Posts: 989
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should not be starting threads when running code in a container. The container is not in control of them so most likely they are never cleaned up correctly and new ones just get created with every ajax timeout.
Unfortunately this sounds like a badly architected solution so you might mave to change some fundamental things to get it right.

For investigation, you can use jconsole to connect to the application to see what threads are running and what is happening to memory CPU e.t.c. You may also be able to see some pointers in your tomcat log files.
 
sadhu charan
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi E Armitage,
Thanks for Your Response, I agree with you but Threads are created in Java timer only for 2 minutes interval I think that is not problem but I will check It,and javascript timer are for checking some windows services
One more doubt if threads are not sucessfully dead is it reason for Hanging System ?


Thanks
SCP

 
E Armitage
Rancher
Posts: 989
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

sadhu charan wrote:Hi E Armitage,
I agree with you but Threads are created in Java timer only for 2 minutes interval

How many are created each time and if you create every two minutes then how many are created after 16 hours?

sadhu charan wrote:Hi E Armitage,
and javascript timer are for checking some windows services

How is this done? Are you calling some OS specific commands that could hang or that could allocate resources that are never released?

sadhu charan wrote:Hi E Armitage,

One more doubt if threads are not sucessfully dead is it reason for Hanging System ?

If you allocate resources that are never released, some limit is eventually going to be reached and the whole thing will just die.

Again, you should not be manually creating threads for code that runs in a container. This is one fundamental problem here. There maybe others too depending on how you are checking those windows services. The solution is not to find a way to clear your manually created threads. The solution is not to manually create threads for code running in a container.

Again, check jconsole and your server's log files for confirmation of what's happening.


 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would also use the Tomcat Management App to monitor the system for memory use, hung request threads, etc.

Bill
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!