title: Mockito, jacoco and surefire causes out of memory
body: <p>I am using mockito 1.8.3, jacoco 0.72 and maven 3.0.5 surefire plugin (2.12.4) to execute unit test and generating coverage report, it was working fine. </p>
  
  <p>With more and more tests are added, it starts not working. I continuously encounter out of memory error during test execution, and cannot find out a way to figure out what is wrong.</p>
  
  <p>I have about 1800+ test cases with mockito as the mocking tool. It is working fine if I do not run jacoco during maven test with "org.jacoco:jacoco-maven-plugin:prepare-agent " before test phase, but as long as I add jacoco agent, I get OOO issue with PermGen full. </p>
  
  <p>I already added the PermGen to 2GB by modifying MAVEN_OPTS (which should not work since surefire will fork a new process) and surefire argline argument in pom, but it does not help a lot. </p>
  
  <p>I try to get a core dump when OOO occurs by adding parameter to surefire plugin, but never saw a dump file in any folder. I am suspicious that my JVM setting does not work for the surefire plugin, but not sure what is wrong. Anyone could do me a favor? Thanks.</p>
  
  <pre><code>            &lt;plugin&gt;
                  &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
                  &lt;version&gt;${surefire.version}&lt;/version&gt;
                  &lt;inherited&gt;true&lt;/inherited&gt;
                  &lt;configuration&gt;
                      &lt;properties&gt;
                          &lt;property&gt;
                              &lt;name&gt;argLine&lt;/name&gt;                                    &lt;value&gt;-server -ea -XX:-UseSplitVerifier -XX:MaxPermSize=2g -Xmx3g -XX:+HeapDumpOnOutOfMemoryError &lt;/value&gt;
                          &lt;/property&gt;
                          &lt;property&gt;
                              &lt;name&gt;forkMode&lt;/name&gt;
                              &lt;value&gt;once&lt;/value&gt;
                          &lt;/property&gt;
                          &lt;property&gt;
                              &lt;name&gt;reportFormat&lt;/name&gt;
                              &lt;value&gt;plain&lt;/value&gt;
                          &lt;/property&gt;
                          &lt;property&gt;
                              &lt;name&gt;skipTests&lt;/name&gt;
                              &lt;value&gt;${maven.test.skip}&lt;/value&gt;
                          &lt;/property&gt;
                      &lt;/properties&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
  </code></pre>