我从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...
答案 0 :(得分:0)
关于我的经验,-XX:MaxPermSize不应该等于-Xmx。 另一方面,它是-Xmx中的子集永久内存。
我发现50%可能足够好了。无论如何,我们需要监控GC 确保配置是否正确。
e.g.
-Xmx512M -XX:MaxPermSize=256M
我希望这可能有所帮助。
此致
Charlee Ch。