Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

surefire HeapDumpOnOutOfMemoryError

When running my unit tests in Maven on windows i'm getting an OutOfMemory exception. I tried to add -XX:-HeapDumpOnOutOfMemoryError option to the surefire argLine, but no dump file is generated. I also tried to add the same thing to MAVEN_OPTS, but still nothing, I simply get an OutOfMemory exception and the process hangs until I manually kill it.

My pom is as follows:

<plugin>
    <artifactId>maven-surefire-plugin</artifactId>
    <configuration>                    
        <testFailureIgnore>false</testFailureIgnore>
        <argLine>-Xms512m -Xmx512m -XX:PermSize=256m -XX:-HeapDumpOnOutOfMemoryError</argLine>
        <forkMode>once</forkMode>            
    </configuration>
</plugin>

MAVEN_OPTS:

set MAVEN_OPTS=-XX:-HeapDumpOnOutOfMemoryError

Do you have any idea why no dump file is generated?

like image 377
Koby Avatar asked Jan 04 '11 18:01

Koby


1 Answers

You're using "-" to disable the option. Use "+" to enable it:

<argLine>... -XX:+HeapDumpOnOutOfMemoryError</argLine>
                 ^ 
like image 112
Aaron Digulla Avatar answered Sep 22 '22 01:09

Aaron Digulla