我正在使用SonarQube版本5.3並使用Jenkins版本1.651來啓動聲納掃描器。我也使用Sonar Java插件版本3.11-build4121。SonarQube分析失敗java.lang.OutOfMemoryError:Java堆空間
內存似乎有問題。從我的調試中,我發現可能的解決方案可能是通過在Jenkins中使用標誌-Xmx來增加最大Java Heap大小。所以我試圖這樣設置:
-Xss1024k -Xmx4096m -XX:MaxPermSize=256m
但是沒有任何成功,因爲它會產生以下錯誤。
2016.03.03 15:30:52 INFO [o.s.s.c.t.CeWorkerCallableImpl] Execute task | project=iipaxprod | id=AVM842148nwKD7ip-06E
2016.03.03 15:30:55 INFO [o.s.s.c.s.ExtractReportStep] Analysis report extracted | compressedSize=49 MB
2016.03.03 15:30:55 INFO [o.s.s.c.s.ComputationStepExecutor] Extract report | time=2485ms
2016.03.03 15:30:55 INFO [o.s.s.c.s.LogScannerContextStep] SonarQube plugins:
2016.03.03 15:30:55 INFO [o.s.s.c.s.LogScannerContextStep] - Java Properties 1.5 (javaProperties)
2016.03.03 15:30:55 INFO [o.s.s.c.s.LogScannerContextStep] - Findbugs 3.3 (findbugs)
2016.03.03 15:30:55 INFO [o.s.s.c.s.LogScannerContextStep] - Java 3.11-build4121 (java)
2016.03.03 15:30:55 INFO [o.s.s.c.s.LogScannerContextStep] - Git 1.1 (scmgit)
2016.03.03 15:30:55 INFO [o.s.s.c.s.LogScannerContextStep] - PMD 2.5 (pmd)
2016.03.03 15:30:55 INFO [o.s.s.c.s.LogScannerContextStep] - Checkstyle 2.4 (checkstyle)
2016.03.03 15:30:55 INFO [o.s.s.c.s.LogScannerContextStep] - SVN 1.2 (scmsvn)
2016.03.03 15:30:55 INFO [o.s.s.c.s.LogScannerContextStep] Settings for module: iipaxprod
2016.03.03 15:30:55 INFO [o.s.s.c.s.LogScannerContextStep] - sonar.core.id=20160302135558
2016.03.03 15:30:55 INFO [o.s.s.c.s.LogScannerContextStep] - sonar.core.startTime=2016-03-02T13:55:58+0100
2016.03.03 15:30:55 INFO [o.s.s.c.s.LogScannerContextStep] - sonar.core.version=5.3
2016.03.03 15:30:55 INFO [o.s.s.c.s.LogScannerContextStep] - sonar.host.url=http://192.168.40.179:9000/
2016.03.03 15:30:55 INFO [o.s.s.c.s.LogScannerContextStep] - sonar.java.source=1.6
2016.03.03 15:30:55 INFO [o.s.s.c.s.LogScannerContextStep] - sonar.login=admin
2016.03.03 15:30:55 INFO [o.s.s.c.s.LogScannerContextStep] - sonar.password=******
2016.03.03 15:30:55 INFO [o.s.s.c.s.LogScannerContextStep] - sonar.permission.template.default=default_template
2016.03.03 15:30:55 INFO [o.s.s.c.s.LogScannerContextStep] - sonar.projectBaseDir=/var/lib/jenkins/jobs/iipax-product-Project/workspace
2016.03.03 15:30:55 INFO [o.s.s.c.s.LogScannerContextStep] - sonar.projectKey=iipaxprod
2016.03.03 15:30:55 INFO [o.s.s.c.s.LogScannerContextStep] - sonar.projectName=iipax-Product
2016.03.03 15:30:55 INFO [o.s.s.c.s.LogScannerContextStep] - sonar.projectVersion=1.0
2016.03.03 15:30:55 INFO [o.s.s.c.s.LogScannerContextStep] - sonar.qualitygate=1
2016.03.03 15:30:55 INFO [o.s.s.c.s.LogScannerContextStep] - sonar.sourceEncoding=ISO-8859-1
2016.03.03 15:30:55 INFO [o.s.s.c.s.LogScannerContextStep] - sonar.sources=.
2016.03.03 15:30:55 INFO [o.s.s.c.s.LogScannerContextStep] - sonar.working.directory=/var/lib/jenkins/jobs/iipax-product-Project/workspace/.sonar
2016.03.03 15:30:55 INFO [o.s.s.c.s.ComputationStepExecutor] Log scanner context | time=5ms
2016.03.03 15:30:55 INFO [o.s.s.c.s.ComputationStepExecutor] Load analysis metadata | time=0ms
2016.03.03 15:30:58 INFO [o.s.s.c.s.ComputationStepExecutor] Build tree of components | time=2846ms
2016.03.03 15:30:59 INFO [o.s.s.c.s.ComputationStepExecutor] Validate project | time=79ms
2016.03.03 15:31:00 INFO [o.s.s.c.s.ComputationStepExecutor] Load debt model | time=1716ms
2016.03.03 15:31:01 INFO [o.s.s.c.s.ComputationStepExecutor] Load quality profiles | time=291ms
2016.03.03 15:31:01 INFO [o.s.s.c.s.ComputationStepExecutor] Load Quality gate | time=151ms
2016.03.03 15:31:01 INFO [o.s.s.c.s.ComputationStepExecutor] Load differential periods | time=35ms
2016.03.03 15:31:01 INFO [o.s.s.c.s.ComputationStepExecutor] Load inner file and in project duplications | time=311ms
2016.03.03 15:31:01 INFO [o.s.s.c.d.CrossProjectDuplicationStatusHolderImpl] Cross project duplication is disabled because it's disabled in the analysis report
2016.03.03 15:31:01 INFO [o.s.s.c.s.ComputationStepExecutor] Compute cross project duplications | time=0ms
2016.03.03 15:31:02 INFO [o.s.s.c.s.ComputationStepExecutor] Compute size measures | time=431ms
2016.03.03 15:31:18 INFO [o.s.s.c.s.ComputationStepExecutor] Compute new coverage | time=16647ms
2016.03.03 15:31:18 INFO [o.s.s.c.s.ComputationStepExecutor] Compute coverage measures | time=47ms
2016.03.03 15:31:19 INFO [o.s.s.c.s.ComputationStepExecutor] Compute comment measures | time=1000ms
2016.03.03 15:31:21 INFO [o.s.s.c.s.ComputationStepExecutor] Copy custom measures | time=1997ms
2016.03.03 15:31:22 INFO [o.s.s.c.s.ComputationStepExecutor] Compute duplication measures | time=915ms
2016.03.03 15:31:25 INFO [o.s.s.c.s.ComputationStepExecutor] Compute duplication data measures | time=2562ms
2016.03.03 15:31:26 INFO [o.s.s.c.s.ComputationStepExecutor] Compute language distribution | time=779ms
2016.03.03 15:31:26 INFO [o.s.s.c.s.ComputationStepExecutor] Compute test measures | time=49ms
2016.03.03 15:31:30 INFO [o.s.s.c.s.ComputationStepExecutor] Compute complexity measures | time=4833ms
2016.03.03 15:31:30 INFO [o.s.s.c.s.ComputationStepExecutor] Load measure computers | time=0ms
2016.03.03 15:40:37 INFO [o.s.s.c.s.ExecuteVisitorsStep] Execution time for each component visitor:
2016.03.03 15:40:37 INFO [o.s.s.c.s.ExecuteVisitorsStep] - LoadComponentUuidsHavingOpenIssuesVisitor | time=5327ms
2016.03.03 15:40:37 INFO [o.s.s.c.s.ExecuteVisitorsStep] - IntegrateIssuesVisitor | time=428288ms
2016.03.03 15:40:37 INFO [o.s.s.c.s.ExecuteVisitorsStep] - CloseIssuesOnRemovedComponentsVisitor | time=0ms
2016.03.03 15:40:37 INFO [o.s.s.c.s.ExecuteVisitorsStep] - SqaleMeasuresVisitor | time=3059ms
2016.03.03 15:40:37 INFO [o.s.s.c.s.ExecuteVisitorsStep] - SqaleNewMeasuresVisitor | time=107507ms
2016.03.03 15:40:37 INFO [o.s.s.c.s.ExecuteVisitorsStep] - LastCommitVisitor | time=112ms
2016.03.03 15:40:37 INFO [o.s.s.c.s.ExecuteVisitorsStep] - MeasureComputersVisitor | time=834ms
2016.03.03 15:40:37 INFO [o.s.s.c.s.ComputationStepExecutor] Execute component visitors | time=546127ms
2016.03.03 15:46:28 ERROR [o.s.s.c.c.ComputeEngineContainerImpl] Cleanup of container failed
java.lang.OutOfMemoryError: Java heap space
2016.03.03 15:46:28 ERROR [o.s.s.c.t.CeWorkerCallableImpl] Failed to execute task AVM842148nwKD7ip-06E
java.lang.OutOfMemoryError: Java heap space
2016.03.03 15:46:28 ERROR [o.s.s.c.t.CeWorkerCallableImpl] Executed task | project=iipaxprod | id=AVM842148nwKD7ip-06E | time=935556ms
我注意到了這個帖子:1它經歷了類似的問題,但這個問題似乎已經解決了一次堆內存大小設置爲4096,它具有不適合我。
關於如何解決此問題的任何建議?
編輯1:拼寫錯誤。
整個項目的規模約爲760mb,並有100萬行代碼。
我升級到SQ 5.4後,Web服務器無法啓動,我在sonar.log中收到以下錯誤(在/ opt/sonar/logs中) ERROR web [ossui.JRubyFacade]渲染失敗:http: //192.168.40.179:9000。 在安裝過程中,我可以選擇替換或保留已編輯的配置文件,並選擇使用新配置文件。 什麼可能導致此問題? –
你應該爲此打開一個新的線程,不能幫你這麼一點細節。 –
@ seb-sonarsource-team我已經打開了一個新線程[here](http://stackoverflow.com/questions/36013847/unable-to-start-sonarqube-server-after-upgrade-to-sonarqube-5-4 ) –