小编Kob*_*oby的帖子

surefire HeapDumpOnOutOfMemoryError

当在Windows上的Maven中运行我的单元测试时,我得到一个OutOfMemory异常.我尝试将-XX:-HeapDumpOnOutOfMemoryError选项添加到surefire argLine,但是没有生成转储文件.我也尝试向MAVEN_OPTS添加相同的东西,但仍然没有,我只是得到一个OutOfMemory异常并且该过程挂起,直到我手动杀死它.

我的pom如下:

<plugin>
    <artifactId>maven-surefire-plugin</artifactId>
    <configuration>                    
        <testFailureIgnore>false</testFailureIgnore>
        <argLine>-Xms512m -Xmx512m -XX:PermSize=256m -XX:-HeapDumpOnOutOfMemoryError</argLine>
        <forkMode>once</forkMode>            
    </configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)

MAVEN_OPTS:

set MAVEN_OPTS=-XX:-HeapDumpOnOutOfMemoryError
Run Code Online (Sandbox Code Playgroud)

你知道为什么没有生成转储文件吗?

out-of-memory surefire maven

6
推荐指数
2
解决办法
1605
查看次数

标签 统计

maven ×1

out-of-memory ×1

surefire ×1