2012-04-11 9 views
5

私はソナーを初めて使っています。私はジェンキンスのソナーをソナー・プルギンで走っています。私はJVMが増加していたときにソナーfindbugsヒープサイズ

Out of memory 
Total memory: 1037M 
free memory: 30M 
Analyzed: D:\Victor\autocreated\webapp\WEB-INF\classes 
    Aux: C:\DOCUME~1\NADBHA~1\LOCALS~1\Temp\findbugs4165854405681394173.jar 
    Aux: C:\DOCUME~1\NADBHA~1\LOCALS~1\Temp\findbugs4688505485649811865.jar 
Total time: 2:04:49.155s 
Final Memory: 358M/989M 
Exception in thread "main" org.sonar.batch.bootstrapper.BootstrapException: org.sonar.api.utils.SonarException: Can not execute Findbugs 
    at org.sonar.runner.Runner.delegateExecution(Runner.java:189) 
    at org.sonar.runner.Runner.execute(Runner.java:78) 
    at org.sonar.runner.Main.main(Main.java:61) 
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:83) 
    at org.sonar.batch.bootstrap.BatchModule.analyze(BatchModule.java:111) 
    at org.sonar.batch.bootstrap.BatchModule.doStart(BatchModule.java:101) 
    at org.sonar.batch.bootstrap.Module.start(Module.java:83) 
    at org.sonar.batch.bootstrap.BootstrapModule.doStart(BootstrapModule.java:102) 
    at org.sonar.batch.bootstrap.Module.start(Module.java:83) 
    at org.sonar.batch.Batch.execute(Batch.java:100) 
    at org.sonar.runner.Launcher.executeBatch(Launcher.java:65) 
    at org.sonar.runner.Launcher.execute(Launcher.java:58) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 
    at java.lang.reflect.Method.invoke(Unknown Source) 
    at org.sonar.runner.Runner.delegateExecution(Runner.java:186) 
    ... 2 more 
Caused by: java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: Java heap space 
    at java.util.concurrent.FutureTask$Sync.innerGet(Unknown Source) 
    at java.util.concurrent.FutureTask.get(Unknown Source) 
    at org.sonar.plugins.findbugs.FindbugsExecutor.execute(FindbugsExecutor.java:112) 
    ... 20 more 
Caused by: java.lang.OutOfMemoryError: Java heap space 

私のソナーのバージョンが2.13

です:

私はFindBugsの下に

でメモリ不足の例外のうち、取得していますジェンキンスから実行していますエラーですJenkinsソナープラグインのオプションを1280に設定すると、以下のエラーが表示されます。

Error occurred during initialization of VM 
Could not reserve enough space for object heap 
Error: Could not create the Java Virtual Machine. 
Error: A fatal exception has occurred. Program will exit`enter code here` 
+0

あなたのマシンはどれくらいのメモリを持っていますか? 1280は利用可能な以上のようです1037M – oers

+0

私のシステムRAMは3GBです。 – vinod

+0

設定したJVMオプションを投稿できますか? –

答えて

5

はい、ソナーのfindbugsエグゼキュータは、解析されたコードベースが大きい場合に多くのRAMを使用できます。

JVMで使用できるヒープサイズだけでなく、 "MaxPermSize"と "ReservedCodeCacheSize"(少なくともJava Hotspot VMの場合)を増やす必要があります。 JVMオプションは、FindBugsソナー実行プログラムを実際に実行しているJVMで設定する必要があります。おそらくジェンキンスのVMではなく、ジェンキンスがその仕事のために始めるものでしょう。ここで

は、64ビットシステムの例を示します。また

-Xmx1536m -XX:MaxPermSize=384m -XX:ReservedCodeCacheSize=128m 

:私はあなたが使用していると仮定しています32ビットシステム上で

-Xmx3062m -XX:MaxPermSize=512m -XX:ReservedCodeCacheSize=128m 

、次のような低い値、のために行くだろうJenkinsがJVMオプションを受け入れない場合は、Jenkinsのソナー・アリ・タスクを使用してソナーを実行することができます。 (これは私がやっていることで、私が好きなだけ多くのメモリを設定することができます)

+0

はJenkinsからMAVEN_OPTS経由ですべての設定を試しましたが、残念ながら成功しませんでした。 – gvasquez