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>
MAVEN_OPTS:
set MAVEN_OPTS=-XX:-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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您的内存泄漏可能刚刚得到修复,请参阅 http://jira.codehaus.org/browse/SUREFIRE- 495..您可能想尝试 Surefire 2.7.1 或更高版本。
Your memory leak might just be fixed, see http://jira.codehaus.org/browse/SUREFIRE-495. You may want to try surefire 2.7.1 or newer.
我认为你忘记了路径:
用这个论点:
I think you forget the path :
with this argument :
您正在使用“-”来禁用该选项。使用“+”来启用它:
You're using "-" to disable the option. Use "+" to enable it:
试试这个:
Try this: