Thanks to everyone who helped with their suggestions!
We have switched the numbers, as you pointed out. Howard's suggestion to add
the following command line options in tomcat7w.exe:
-Xmx4096m
-XX:MaxPermSize=512m
-XX:+UseTLAB
-XX:+UseConcMarkSweepGC
-XX:+CMSClassUnloadingEnableddid the trick. The CPU utilization by Tomcat is
now really-really low. We'll keep an eye on it, but so far-so good.
Cheers,Dima
> Date: Wed, 30 Jan 2013 13:06:15 -0500
> Subject: Re: Tomcat using near 100% of CPU on Windows 2008
> From: smithh032...@gmail.com
> To: users@tomcat.apache.org
>
> On Wed, Jan 30, 2013 at 12:27 PM, Dima Iva <ots...@live.com> wrote:
>
> >
> > We have a Windows 2008 R2 virtual machine on an ESXi server. It only runs
> > one application that requires Apache, Tomcat, Java and PostgreSQL. We have
> > the latest versions of these programs. The machine has 1TB of disk space
> > and 8GB of RAM. When I start the Tomcat 7 service, it starts using around
> > 95% of CPU in a span of a minute, after which the total utilization of CPU
> > by the machine is 100%. Process Explorer shows that the number of threads
> > for this process goes up to 91 and one of them shows over 15,000,000 Cycles
> > Delta and uses all the CPU. While the machine is stalled by Tomcat, the
> > commit charge for the machine is at 12% and physical memory usage at 25%,
> > only the CPU is maxed out.
> >
> > I added CATALINA_OPTS=-Xms4096m -Xmx512m to the Environment Variables, but
> > it doesn't seem to help. I believe there is a memory leak here, but not
> > sure how to pinpoint it using free tools and patch this leak.
> >
> >
> I am not one of the expert Tomcat users or committers, but I am using TomEE
> via Tomcat 7.0.35 Windows service (tomcat7w.exe) on Windows Server 2008 R2
> with 32GB RAM and 1TB hard drive too (after migrating from Windows Server
> 2003 4GB RAM). Maybe I have not monitored it closely, but i have not seen
> the 100% CPU spike that you have experienced and I have found tomee/tomcat
> to be stable on Windows Server 2008 R2.
>
> Instead of using CATALINA_OPTS=..., I specify the following java
> commandline options in the tomcat7 service dialog window
> (tomcat7/bin/tomcat7w.exe):
>
> -Xmx4096m
> -XX:MaxPermSize=512m
> -XX:+UseTLAB
> -XX:+UseConcMarkSweepGC
> -XX:+CMSClassUnloadingEnabled