hudson中的java OutOfMemoryError

时间:2011-02-03 01:16:32

标签: hudson hudson-plugins

我在hudson中运行pmd,findbugs时遇到以下错误。

FATAL: Java heap space  
java.lang.OutOfMemoryError: Java heap space  
    at java.util.HashMap.(Unknown Source)  
    at hudson.plugins.analysis.util.model.AnnotationContainer.initialize(AnnotationContainer.java:163)  
    at hudson.plugins.analysis.util.model.AnnotationContainer.(AnnotationContainer.java:119)  
    at hudson.plugins.analysis.util.model.WorkspaceFile.(WorkspaceFile.java:25)  
    at hudson.plugins.analysis.util.model.AnnotationContainer.addFile(AnnotationContainer.java:303)  
    at hudson.plugins.analysis.util.model.AnnotationContainer.updateMappings(AnnotationContainer.java:212)  
    at hudson.plugins.analysis.util.model.AnnotationContainer.addAnnotation(AnnotationContainer.java:317)  
    at hudson.plugins.analysis.util.model.AnnotationContainer.addAnnotations(AnnotationContainer.java:327)  
    at hudson.plugins.analysis.core.BuildResult.initialize(BuildResult.java:266)  
    at hudson.plugins.analysis.core.BuildResult.(BuildResult.java:206)  
    at hudson.plugins.findbugs.FindBugsResult.(FindBugsResult.java:40)  
    at hudson.plugins.findbugs.FindBugsPublisher.perform(FindBugsPublisher.java:132)  
    at hudson.plugins.analysis.core.HealthAwarePublisher.perform(HealthAwarePublisher.java:280)  
    at hudson.tasks.BuildStepMonitor$2.perform(BuildStepMonitor.java:27)  
    at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:603)  
    at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:582)  
    at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:560)  
    at hudson.model.Build$RunnerImpl.post2(Build.java:156)  
    at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:529)  
    at hudson.model.Run.run(Run.java:1349)  
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)  
    at hudson.model.ResourceController.execute(ResourceController.java:88)  
    at hudson.model.Executor.run(Executor.java:139)  

我为pmd指定了jvmargs,findbugs和ant_opts设置为1024M。

1 个答案:

答案 0 :(得分:0)

如果您在Windows中,则必须编辑hudson.xml文件以包含java参数 -Xmx1024m,但是如果你在* nix环境中,你必须运行命令

export JAVA_OPTS=-Xmx1024m

或更合理的内存大小。