title: Why does Tomcat opens so many Java Processes for my Application?
body: <p>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. </p>
  
  <p>My setenv.sh file contains the following: </p>
  
  <pre><code>CATALINA_OPTS="
  -server 
  -Xms1G 
  -Xmx2G
  -XX:MaxPermSize=512m";
  </code></pre>
  
  <p>I used <strong>htop</strong> to get the number of running processes. I figured out that there are more than 20 running java processes on my system. </p>
  
  <p>Each process of the more than 20 processes looks like this: </p>
  
  <pre><code>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
  </code></pre>
  
  <p>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. </p>
  
  <ol>
  <li>Why is tomcat starting so many processes for my application?</li>
  <li>Do I have to limit them? If so how?</li>
  </ol>