title: Running out of memory with gwt:run-codeserver
body: <p>I have a large GWT application that I'd like to test through Super Dev Mode.</p>
  
  <p>When running the app with</p>
  
  <pre><code>mvn gwt:run-codeserver
  </code></pre>
  
  <p>it will compile OK and provide the URL for the server. At this point I fire up my app in a web browser and try to compile it again use the bookmarklets. This second compile brings up a range of memory errors like:</p>
  
  <pre><code>Caused by: java.lang.OutOfMemoryError: Java heap space    
  ...
  [ERROR] Out of memory; to increase the amount of memory, use the -Xmx flag at startup (java -Xmx128M ...)
  </code></pre>
  
  <p>So it's no secret that I need to assign more memory to the Java process running the server. What I can't work out is how to do that.</p>
  
  <p>I have the following in my pom.xml</p>
  
  <pre><code>&lt;plugin&gt;                                    
      &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
      &lt;artifactId&gt;gwt-maven-plugin&lt;/artifactId&gt;
      &lt;version&gt;${gwt.maven.version}&lt;/version&gt;
      &lt;configuration&gt;
          &lt;extraJvmArgs&gt;-Xmx2048M -Xms1024M -Xss1024k -XX:MaxPermSize=256M -XX:PermSize=128M&lt;/extraJvmArgs&gt;
      &lt;/configuration&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p>My MAVEN_OPTS environment variable is set to</p>
  
  <pre><code>MAVEN_OPTS=-Xmx2048M
  </code></pre>
  
  <p>And I have tried executing maven with</p>
  
  <pre><code>mvn -Dgwt.extraJvmArgs=-Xmx2048M gwt:run-codeserver
  </code></pre>
  
  <p>I have also tried it with the Oracle JDK and the open source JDK supplied with Fedora.</p>
  
  <p>Nothing makes any difference. What am I doing wrong here?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I can confirm that this is an issue with the Maven plugin, and not the code. Running the project using IntelliJ's built in support for Super Dev Mode allow me to compile and recompile the application just fine. So this boils down to knowing the correct way to increase the memory that the Maven plugin has access too. It is obviously not one of the ways I have tried above...</p>