title: Increase Tomcat memory settings
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/88235/dealing-with-java-lang-outofmemoryerror-permgen-space-error">Dealing with &ldquo;java.lang.OutOfMemoryError: PermGen space&rdquo; error</a>  </p>
  </blockquote>
  
  
  
  <p>I have 8GB RAM in my development machine, and am trying to run Apache Tomcat (7.0.29) to host both <a href="http://wiki.jfrog.org/confluence/display/RTF/Requirements" rel="noreferrer">Artifactory</a> (2.6.3) and <a href="http://jenkins-ci.org/" rel="noreferrer">Jenkins</a> (1.479) at the same time. I tried to find the memory requirements for Jenkins but it looks like their wiki is down.</p>
  
  <p>In <code>${TOMCAT_HOME}/bin/catalina.sh</code>, I have added the following command:</p>
  
  <pre><code>CATALINA_OPTS="$CATALINA_OPTS -server -Xms1024m -Xmx3052m"
  </code></pre>
  
  <p>This should keep Tomcat's JVM between (essentially) 1 and 3 GB in size, leaving me plenty of room for other stuff, <strong>and</strong> giving Tomcat enough memory for Artifactory/Jenkins, and even others if I wanted.</p>
  
  <p>(For what it's worth I've tried the same with <code>JAVA_OPTS</code> only to get the same exact result). I save that change and run <code>startup.sh</code>. Tomcat begins to start up, and then dies with OOMEs complaining that Tomcat has ran out of PermGen space:</p>
  
  <pre><code>Exception in thread "SocketListener(&lt;hex-stuff&gt;.local.)"
  java.lang.OutOfMemoryError: PermGen space
  java.lang.OutOfMemoryError: PermGen space
  java.lang.OutOfMemoryError: PermGen space
  Exception in thread "hudson initialization thread" java.lang.OutOfMemoryError: PermGen space
  java.lang.OutOfMemoryError: PermGen space
  </code></pre>
  
  <p>Where am I going awrye here? I have read multiple articles on how to do this and (believe!) I'm following them precisely. Any thoughts, or ideas as to how I could debug this further? Thanks in advance!</p>