title: How to make sure that Tomcat6 reads CATALINA_OPTS on Windows?
body: <p>I have a Tomcat6 running on a Windows2003 machine.
  I deployed 2 Grails apps on this server and I soon noticed that everything was crashing sometime after the deploy with a classic PermGen error.</p>
  
  <pre><code>java.lang.OutOfMemoryError: PermGen space
   java.lang.ClassLoader.defineClass1(Native Method)
   java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
   java.lang.ClassLoader.defineClass(ClassLoader.java:616)
   org.codehaus.groovy.reflection.ClassLoaderForClassArtifacts.de 
  ...
  </code></pre>
  
  <p>So I found a common fix for this problem: increasing heap and permgen space with:</p>
  
  <pre><code>set CATALINA_OPTS="-Xms1024m -Xmx1024m -XX:PermSize=128m -XX:MaxPermSize=512m"
  </code></pre>
  
  <p>Added into C:\apache-tomcat-6.0.26\bin\catalina.bat.
  Unfortunately this didn't work, but the problem is that I'm not sure that Tomcat is picking it up. I checked various logs but these options are never printed out.
  Is there a way to log them and make sure that Tomcat has read them?</p>
  
  <p>EDIT: I tried to add the following JVM options with tomcat6w.exe:</p>
  
  <pre><code>-XX:+CMSClassUnloadingEnabled
  -XX:+CMSPermGenSweepingEnabled 
  -XX:+UseConcMarkSweepGC
  </code></pre>
  
  <p>And nothing changed. I get a permGen after 2-3 minutes of uptime.
  Any other idea?</p>
  
  <p>Cheers!
  Mulone</p>