我試圖做聲納2.11代碼分析,使用maven 3.無法執行FindBugs的:java.lang.OutOfMemoryError:Java堆空間,同時運行MVN聲納:聲納-X
我面對這錯誤
java.lang.OutOfMemoryError: Java heap space
。
我試圖增加MAVEN_OPTS到-Xmx1024m -Xms512m -XX:MaxPermSize=256m
但沒用。
該項目大小約900MB。我在maven 3中使用命令mvn sonar:sonar -X
。但構建失敗。 我沒有運行測試,也沒有在superPOM中使用任何surefire插件。所以我無法找到問題的原因。 請幫我弄清楚問題出在哪裏。 在此先感謝... 這裏是日誌...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] PHOENIX JAVA MODULE COMPONENT ..................... SKIPPED
[INFO] PHOENIX JAVA COMPONENT ............................ FAILURE [1:27:23.969s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:27:26.229s
[INFO] Finished at: Fri Dec 14 14:14:24 IST 2012
[INFO] Final Memory: 287M/1016M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on project XXX: Can not execute Sonar: Can not execute Findbugs: java.lang.OutOfMemoryError: Java heap space -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on project XXX: Can not execute Sonar
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
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.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: Can not execute Sonar
at org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:118)
at org.codehaus.mojo.sonar.Bootstraper.start(Bootstraper.java:65)
at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:90)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
Caused by: org.sonar.api.utils.SonarException: Can not execute Findbugs
at org.sonar.plugins.findbugs.FindbugsExecutor.execute(FindbugsExecutor.java:120)
at org.sonar.plugins.findbugs.FindbugsSensor.analyse(FindbugsSensor.java:58)
at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:64)
at org.sonar.batch.phases.Phases.execute(Phases.java:93)
at org.sonar.batch.bootstrap.ProjectModule.doStart(ProjectModule.java:143)
at org.sonar.batch.bootstrap.Module.start(Module.java:89)
at org.sonar.batch.bootstrap.BatchModule.analyze(BatchModule.java:110)
at org.sonar.batch.bootstrap.BatchModule.analyze(BatchModule.java:105)
at org.sonar.batch.bootstrap.BatchModule.doStart(BatchModule.java:100)
at org.sonar.batch.bootstrap.Module.start(Module.java:89)
at org.sonar.batch.bootstrap.BootstrapModule.doStart(BootstrapModule.java:96)
at org.sonar.batch.bootstrap.Module.start(Module.java:89)
at org.sonar.batch.Batch.execute(Batch.java:74)
at org.sonar.maven3.SonarMojo.executeBatch(SonarMojo.java:147)
at org.sonar.maven3.SonarMojo.execute(SonarMojo.java:136)
at org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:113)
... 23 more
Caused by: java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: Java heap space
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:232)
at java.util.concurrent.FutureTask.get(FutureTask.java:91)
at org.sonar.plugins.findbugs.FindbugsExecutor.execute(FindbugsExecutor.java:112)
... 38 more
Caused by: java.lang.OutOfMemoryError: Java heap space
at java.util.ArrayList.<init>(ArrayList.java:112)
at edu.umd.cs.findbugs.ba.Frame.<init>(Frame.java:110)
at edu.umd.cs.findbugs.ba.vna.ValueNumberFrame.<init>(ValueNumberFrame.java:58)
at edu.umd.cs.findbugs.ba.vna.ValueNumberAnalysis.createFact(ValueNumberAnalysis.java:148)
at edu.umd.cs.findbugs.ba.vna.ValueNumberAnalysis.createFact(ValueNumberAnalysis.java:55)
at edu.umd.cs.findbugs.ba.Dataflow.execute(Dataflow.java:309)
at edu.umd.cs.findbugs.classfile.engine.bcel.ValueNumberDataflowFactory.analyze(ValueNumberDataflowFactory.java:72)
at edu.umd.cs.findbugs.classfile.engine.bcel.ValueNumberDataflowFactory.analyze(ValueNumberDataflowFactory.java:47)
at edu.umd.cs.findbugs.classfile.impl.AnalysisCache.analyzeMethod(AnalysisCache.java:332)
at edu.umd.cs.findbugs.classfile.impl.AnalysisCache.getMethodAnalysis(AnalysisCache.java:282)
at edu.umd.cs.findbugs.ba.ClassContext.getMethodAnalysis(ClassContext.java:942)
at edu.umd.cs.findbugs.ba.ClassContext.getValueNumberDataflow(ClassContext.java:361)
at edu.umd.cs.findbugs.detect.FindInconsistentSync2.findObviouslyLockedCallSites(FindInconsistentSync2.java:963)
at edu.umd.cs.findbugs.detect.FindInconsistentSync2.visitClassContext(FindInconsistentSync2.java:311)
at edu.umd.cs.findbugs.DetectorToDetector2Adapter.visitClass(DetectorToDetector2Adapter.java:68)
at edu.umd.cs.findbugs.FindBugs2.analyzeApplication(FindBugs2.java:979)
at edu.umd.cs.findbugs.FindBugs2.execute(FindBugs2.java:230)
at org.sonar.plugins.findbugs.FindbugsExecutor$FindbugsTask.call(FindbugsExecutor.java:137)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :XXX
'mvn findbugs:findbugs'給你什麼?以及你需要在http://mojo.codehaus.org/findbugs-maven-plugin/findbugs-mojo.html#jvmArgs上設置permgen來使'findbugs:findbugs'工作。我懷疑有一些神奇的祕密聲納配置是相當的(如果它不只是委託給'findbugs:findbugs',否則你將需要提高聲納bug「 –
@StephenConnolly當我運行'mvn findbugs:findbugs'編譯失敗,出現此錯誤執行目標org.codehaus.mojo的默認cli:findbugs-maven-plugin:2.5.2:findbugs失敗:Java返回:1' – 304751
因此,現在嘗試改變它的配置與forkMode真正的,增加內存(最有可能只是permgen),直到它不會崩潰,這將告訴你有多少內存找到錯誤需要*沒有聲納在混合中......然後,你可以調整聲納,一旦你有這個答案 –