surefire maven memory problems

Problem:

[INFO] [surefire:test {execution: default-test}]
[INFO] Surefire report directory: C:\...\target\surefire-reports
Error occurred during initialization of VM
Could not create the Java virtual machine.
Could not reserve enough space for object heap

Solution:
Edit your pom.xml and add configuration option for surefire forkMode none:

  <build>
    <plugins>
    (...)
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-surefire-plugin</artifactId>
      <configuration>
        <forkMode>none</forkMode>
      </configuration>
    </plugin>
    (...)

Posted by wojtek Tue, 09 Mar 2010 16:27:00 GMT




Comments

Leave a response

  1. Dave A about 1 month later:

    Found all kinds of memory setting tricks elsewhere (-Dsurefire.memory=”-Xmx512m”), but your solution is the one that worked!

    Thanks a bunch!

Leave a comment