title: Grails 2.0 PermGem space with run-war
body: <p>I've an basic app that working fine when i'm runngin it with <code>grails run-app</code>, and I want to run it using <code>grails run-war</code>. But i'm always getting famous tomcat's <code>java.lang.OutOfMemoryError: PermGem space</code> error, on any request, just after start.</p>
  
  <p>Well, I know that I need to change <code>PermSize</code> value, so I tried all ways that i've found after googling (<code>JAVA_OPTS</code>, <code>GRAILS_OPTS</code> and <code>grails.tomcat.jvmArgs</code>), and now I have following script:</p>
  
  <pre><code>export JAVA_OPTS="-Xms256m -Xmx1024m -XX:PermSize=512m -XX:MaxPermSize=512m"
  export GRAILS_OPTS="-Xms256m -Xmx1024m -XX:PermSize=512m -XX:MaxPermSize=512m"
  grails -Dgrails.tomcat.jvmArgs="-Xms256m -Xmx1024m -XX:PermSize=512m -XX:MaxPermSize=512m" run-war
  </code></pre>
  
  <p>but it doesn't help. Still having <code>java.lang.OutOfMemoryError: PermGen space</code> on first request.</p>
  
  <p>What i'm doing wrong? Is there any other way to configure <code>PermSize</code> for Grails 2.0.1?</p>
  
  <p>Update: I run <code>ps -ef | grep java</code> and found that Grails actually got my params, but then it ran a new process, for tomcat, w/o this params.</p>