Saturday, 17 August 2013

Why does Tomcat opens so many Java Processes for my Application?

Why does Tomcat opens so many Java Processes for my Application?

I have a Grails 2.2.4 application which is packed as war and deployed to
my tomcat7 server on ubuntu 12.04 LTS 64-bit, 8GB RAM.
My setenv.sh file contains the following:
CATALINA_OPTS="
-server
-Xms1G
-Xmx2G
-XX:MaxPermSize=512m";
I used htop to get the number of running processes. I figured out that
there are more than 20 running java processes on my system.
Each process of the more than 20 processes looks like this:
PRI NI VIRT RES SHR S CPU% MEM* TIME+ Command
20 0 6028M 1290M 11140 S 0.0 16.2 0:01.21
/usr/lib/jvm/java-7-oracle/bin/java -Djava.util.logging.config.file
When I stat tomcat with ./bin/startup.sh my application starts without
errors. When I access my application with different browsers I get more
than 20 Java processes running. The only other Java process I have running
is elasticsearch.
Why is tomcat starting so many processes for my application?
Do I have to limit them? If so how?

No comments:

Post a Comment