title: java.lang.OutOfMemoryError: PermGen space error with Jetty
body: <p>I am currently getting an <code>java.lang.OutOfMemoryError: PermGen space</code>. I am using Jetty and Linux Ubuntu. I have tried reading and attempting the different solutions that were provided in previous similar questions but I am not having any success. One similar question was </p>
  
  <p><a href="https://stackoverflow.com/questions/88235/dealing-with-java-lang-outofmemoryerror-permgen-space-error?rq=1">Dealing with “java.lang.OutOfMemoryError: PermGen space” error</a></p>
  
  <p>But these solutions seem to be using Tomcat instead of Jetty. I keep getting the out of memeory error if I redeploy my service a few times. For example to test this I am going to my webapps folder and running touch *.xml to update the time stamp then re-run jetty and I get the out of memory error. In my jetty folder (the one that includes bin, doc, etc, lib, logs, modules, start.jar) I am running </p>
  
  <pre><code>java -jar ../start.jar
  </code></pre>
  
  <p>But this gives me the error. I then tried what I read in the other examples such as:</p>
  
  <pre><code>java -jar ../start.jar JAVA_OPTS="-Xms256m -Xmx512m -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled"
  </code></pre>
  
  <p>or</p>
  
  <pre><code>-XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled
  </code></pre>
  
  <p>or </p>
  
  <pre><code>-XX:MaxPermSize=128m
  </code></pre>
  
  <p>Then when I go to firefox and navigate to <code>localhost:8080</code> and refresh, in the terminal I keep getting the error</p>
  
  <pre><code>java.lang.OutOfMemoryError: PermGen space
  </code></pre>