title: How to solve "GC overhead limit exceeded" using maven jvmArg?
body: <p>When running a class I have the following exception:</p>
  
  <blockquote>
    <p>Exception in thread "main" java.lang.OutOfMemoryError: GC overhead limit exceeded</p>
  </blockquote>
  
  <p>I've tried to increase the jvmArg heap size from inside maven pom.xml of the class package: </p>
  
  <p>http://maven.apache.org/xsd/maven-4.0.0.xsd">
      4.0.0</p>
  
  <pre><code>&lt;parent&gt;
      (...)
  &lt;/parent&gt;
  
  
  &lt;artifactId&gt;(...)&lt;/artifactId&gt;
  &lt;name&gt;(...)&lt;/name&gt;
  
  &lt;properties&gt;
      &lt;javaOpts.Xmx&gt;4g&lt;/javaOpts.Xmx&gt; &lt;!-- default that can be adjusted on the command line with -DjavaOpts.Xmx=... --&gt;
      &lt;(...).basedir&gt;${project.basedir}/..&lt;/(...).basedir&gt;
  &lt;/properties&gt;
  
  &lt;build&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;net.alchim31.maven&lt;/groupId&gt;
              &lt;artifactId&gt;scala-maven-plugin&lt;/artifactId&gt;
              &lt;configuration&gt;
                  &lt;launchers&gt;
                      &lt;launcher&gt;
                          &lt;id&gt;MyClassName&lt;/id&gt;
                          &lt;mainClass&gt;(...)&lt;/mainClass&gt;
                          &lt;jvmArgs&gt;
                              &lt;jvmArg&gt;-Xmx${javaOpts.Xmx}&lt;/jvmArg&gt;
                          (...) 
  </code></pre>
  
  <p>I've tried the last cited line with many values:</p>
  
  <ul>
  <li><code>&lt;jvmArg&gt;-Xmx512m{javaOpts.Xmx}&lt;/jvmArg&gt;</code></li>
  <li><code>&lt;jvmArg&gt;-Xmx4096M{javaOpts.Xmx}&lt;/jvmArg&gt;</code></li>
  <li>...</li>
  <li><code>&lt;jvmArg&gt;-Xmx10000000000M{javaOpts.Xmx}&lt;/jvmArg&gt;</code></li>
  </ul>
  
  <p>But for all of them I have the same error.</p>
  
  <p>Anyone can help me?
  Observation: I'm running from <strong>IntelliJ IDEA</strong>.</p>