title: Maven Jetty Plugin OutOfMemoryError When Sharing Instance Between Two Web Apps
body: <p>I'm using the maven jetty plugin to run my two web applications.  One web application is spring mvc UI and the other is a RESTful web application.  I able to get the two web applications to communicate when I run two separate mvn jetty:run instances and assign different ports. I have successfully deploy both in the same jetty instance using the same port using the below maven pom.xml configuration.  I eventually get a ava.lang.OutOfMemoryError: PermGen space error.  What is the best workaround for this?  </p>
  
  <pre><code>&lt;plugin&gt;
      &lt;groupId&gt;org.mortbay.jetty&lt;/groupId&gt;
      &lt;artifactId&gt;jetty-maven-plugin&lt;/artifactId&gt;
      &lt;version&gt;7.6.8.v20121106&lt;/version&gt;
      &lt;configuration&gt;
          &lt;jvmArgs&gt;-Xmx2024m -Xms2024m&lt;/jvmArgs&gt;
          &lt;scanIntervalSeconds&gt;10&lt;/scanIntervalSeconds&gt;
          &lt;webApp&gt;
              &lt;contextPath&gt;/&lt;/contextPath&gt;
          &lt;/webApp&gt;
          &lt;contextHandlers&gt;           
              &lt;contextHandler implementation="org.eclipse.jetty.webapp.WebAppContext"&gt;
                  &lt;war&gt;../../api/target/main-api.war&lt;/war&gt;
                  &lt;contextPath&gt;/test&lt;/contextPath&gt;
              &lt;/contextHandler&gt;
          &lt;/contextHandlers&gt; 
      &lt;/configuration&gt;
  &lt;/plugin&gt;
  </code></pre>