Clover Java堆空间错误
我在从 hudson 运行时遇到 java 堆空间错误,我将我的 MAVEN_OPTS
设置如下,任何人都可以让我知道此问题的解决方案是什么。
-Xmx4096m -XX:PermSize=3000m -XX:MaxPermSize=4096m
[INFO] ------------------------------------------------------------------------ [ERROR] FATAL ERROR [INFO] ------------------------------------------------------------------------ [INFO] Java heap space [INFO] ------------------------------------------------------------------------ [INFO] Trace`enter code here` java.lang.OutOfMemoryError: Java heap space at java.util.BitSet.initWords(BitSet.java:144) at java.util.BitSet.(BitSet.java:139) at com.cenqua.clover.InMemPerTestCoverage.(InMemPerTestCoverage.java:66) at com.cenqua.clover.CloverDatabase.mergePerTestCoverage(CloverDatabase.java:494) at com.cenqua.clover.CloverDatabase.merge(CloverDatabase.java:437) at com.cenqua.clover.CloverMerge.mainImpl(CloverMerge.java:36) at com.atlassian.maven.plugin.clover.CloverAggregateMojo.mergeCloverDatabases(CloverAggregateMojo.java:260) at com.atlassian.maven.plugin.clover.CloverAggregateMojo.execute(CloverAggregateMojo.java:79) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490) at hudson.maven.agent.PluginManagerInterceptor.executeMojo(PluginManagerInterceptor.java:182) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:284) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180) at org.apache.maven.lifecycle.LifecycleExecutorInterceptor.execute(LifecycleExecutorInterceptor.java:65) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138) at org.apache.maven.cli.MavenCli.main(MavenCli.java:362) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at hudson.maven.agent.Main.launch(Main.java:185) at hudson.maven.MavenBuilder.call(MavenBuilder.java:165) at hudson.maven.MavenModuleSetBuild$Builder.call(MavenModuleSetBuild.java:1005) at hudson.maven.MavenModuleSetBuild$Builder.call(MavenModuleSetBuild.java:936) at hudson.remoting.UserRequest.perform(UserRequest.java:118) at hudson.remoting.UserRequest.perform(UserRequest.java:48) [INFO] ------------------------------------------------------------------------ [INFO] Total time: 87 minutes 35 seconds [INFO] Finished at: Thu Jul 21 12:20:13 PDT 2011 [INFO] Final Memory: 112M/3123M [INFO] ------------------------------------------------------------------------ channel stopped Publishing Clover coverage report...
I am getting java heap space error while running from hudson and I set my MAVEN_OPTS
as below, any body can let me know what is the resolution for this issue.
-Xmx4096m -XX:PermSize=3000m -XX:MaxPermSize=4096m
[INFO] ------------------------------------------------------------------------ [ERROR] FATAL ERROR [INFO] ------------------------------------------------------------------------ [INFO] Java heap space [INFO] ------------------------------------------------------------------------ [INFO] Trace`enter code here` java.lang.OutOfMemoryError: Java heap space at java.util.BitSet.initWords(BitSet.java:144) at java.util.BitSet.(BitSet.java:139) at com.cenqua.clover.InMemPerTestCoverage.(InMemPerTestCoverage.java:66) at com.cenqua.clover.CloverDatabase.mergePerTestCoverage(CloverDatabase.java:494) at com.cenqua.clover.CloverDatabase.merge(CloverDatabase.java:437) at com.cenqua.clover.CloverMerge.mainImpl(CloverMerge.java:36) at com.atlassian.maven.plugin.clover.CloverAggregateMojo.mergeCloverDatabases(CloverAggregateMojo.java:260) at com.atlassian.maven.plugin.clover.CloverAggregateMojo.execute(CloverAggregateMojo.java:79) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490) at hudson.maven.agent.PluginManagerInterceptor.executeMojo(PluginManagerInterceptor.java:182) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:284) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180) at org.apache.maven.lifecycle.LifecycleExecutorInterceptor.execute(LifecycleExecutorInterceptor.java:65) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138) at org.apache.maven.cli.MavenCli.main(MavenCli.java:362) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at hudson.maven.agent.Main.launch(Main.java:185) at hudson.maven.MavenBuilder.call(MavenBuilder.java:165) at hudson.maven.MavenModuleSetBuild$Builder.call(MavenModuleSetBuild.java:1005) at hudson.maven.MavenModuleSetBuild$Builder.call(MavenModuleSetBuild.java:936) at hudson.remoting.UserRequest.perform(UserRequest.java:118) at hudson.remoting.UserRequest.perform(UserRequest.java:48) [INFO] ------------------------------------------------------------------------ [INFO] Total time: 87 minutes 35 seconds [INFO] Finished at: Thu Jul 21 12:20:13 PDT 2011 [INFO] Final Memory: 112M/3123M [INFO] ------------------------------------------------------------------------ channel stopped Publishing Clover coverage report...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据我的经验,-XX:MaxPermSize 不应等于-Xmx。
另一方面,它是 -Xmx 内部永久内存的子集。
我发现 50% 可能就足够了。无论如何我们需要监控GC
以确保配置是否正确。
我希望这会有所帮助。
问候,
查理 Ch.
Regarding to my experience, the -XX:MaxPermSize should not be equal to the -Xmx.
On the other hand, it is a subset permanent memory inside the -Xmx.
I've found that the 50% may be good enough. Anyhow we need to monitor the GC
for ensuring if it is configured properly or not.
I hope this may help.
Regards,
Charlee Ch.