gpt4 book ai didi

java - Clover Java堆空间错误

转载 作者:行者123 更新时间:2023-12-01 05:42:22 25 4
gpt4 key购买 nike

我在从 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...

最佳答案

根据我的经验,-XX:MaxPermSize 不应等于-Xmx。另一方面,它是 -Xmx 内部永久内存的子集。

我发现 50% 可能就足够了。无论如何我们需要监控GC以确保配置是否正确。

e.g.
-Xmx512M -XX:MaxPermSize=256M

希望这会有所帮助。

问候,

查理奇

关于java - Clover Java堆空间错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6783336/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com