we are hosting web applictions using Apache-Tomcat, Past two weeks iam facing this problem, in my server suddenly the java usage is become extreme(100%) , because of this issue my clients not able to access the
application . so after i restart the tomcat only they can able to access the Web application.
Please guide to avoid critical situations.
1. How to avoid high cpu usage
2. is there any way to reduce the cpu usage once it becomes high. instead of restart the tomcat.
Tomcat is not some sort of creature with a life of its own to just spntaneously crank up its CPU usage. And, since it's a fairly minimal J2EE container, its normal resource consumption isn't very high as such things go.
The first thing to check, then, is to see if you have a system memory problem. If you're using lots of virtual memory, then any app can send CPU usage through the roof. Not because the app is using the CPU, but because page-swapping is using CPU. So check the virtual/real RAM and swap stats for your machine.
If you have plenty of machine resources, the chances are very high that it's not Tomcat that's running 100% CPU, it's user-supplied software inside of Tomcat that's running 100% CPU. At that point you'll need to break out the system performance measuring tools.
An IDE is no substitute for an Intelligent Developer.