title: Grails application hogging too much memory
body: <p>Tomcat 5.5.x and 6.0.x</p>
  
  <p>Grails 1.6.x</p>
  
  <p>Java 1.6.x</p>
  
  <p>OS CentOS 5.x (64bit)</p>
  
  <p>VPS Server with memory as 384M</p>
  
  <p>JAVA_OPTS : tried many combinations- including the following</p>
  
  <p>export JAVA_OPTS='-Xms128M -Xmx512M -XX:MaxPermSize=1024m'</p>
  
  <p>export JAVA_OPTS='-server -Xms128M -Xmx128M -XX:MaxPermSize=256M'</p>
  
  <p>(As advised by <a href="http://www.grails.org/Deployment" rel="nofollow noreferrer">http://www.grails.org/Deployment</a>)</p>
  
  <p>I have created a blank Grails application i.e simply by giving the command grails create-app and then WARed it</p>
  
  <p>I am running Tomcat on a VPS Server</p>
  
  <p>When I simply start the Tomcat server, with no apps deployed, the free memory is about 236M
  and used memory is about 156M</p>
  
  <p>When I deploy my "blank" application, the memory consumption spikes to 360M and finally the Tomcat instance is killed as soon as it takes up all free memory</p>
  
  <p>As you have seen, my app is as light as it can be.</p>
  
  <p>Not sure why the memory consumption is as high it is.</p>
  
  <p>I am actually troubleshooting a real application, but have narrowed down to this scenario which is easier to share and explain.</p>
  
  <p><strong>UPDATE</strong>
  I tested the same "blank" application on my local Tomcat 5.5.x on Windows and it worked fine</p>
  
  <p>The memory consumption of the Java process shot from 32 M to 107M. But it did not crash and it remained under acceptable limits</p>
  
  <p>So the hunt for answer continues... I wonder if something is wrong about my Linux box. Not sure what though...</p>
  
  <p><strong>UPDATE 2</strong>
  Also see this <a href="http://www.grails.org/Grails+Test+On+Virtual+Server" rel="nofollow noreferrer">http://www.grails.org/Grails+Test+On+Virtual+Server</a></p>
  
  <p>It confirms my belief that my simple-blank app should work on my configuration.</p>