如何解决 Sonarqube java.lang.OutOfMemoryError: Java heap space [英] How to solve Sonarqube java.lang.OutOfMemoryError: Java heap space

查看:34
本文介绍了如何解决 Sonarqube java.lang.OutOfMemoryError: Java heap space的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Sonarqube 社区版.我收到以下错误,

I'm using Sonarqube community version. I'm getting the following error,

Exception in thread "LOG_FLUSHER" Exception in thread "CHECKPOINT_WRITER" java.lang.OutOfMemoryError: Java heap space
        at java.util.ArrayList.iterator(ArrayList.java:840)
        at java.util.Collections$SynchronizedCollection.iterator(Collections.java:2031)
        at com.persistit.Persistit.pollAlertMonitors(Persistit.java:2285)
        at com.persistit.Persistit$LogFlusher.run(Persistit.java:192)
java.lang.OutOfMemoryError: Java heap space
        at java.util.HashMap$Values.iterator(HashMap.java:968)
        at com.persistit.Persistit.earliestDirtyTimestamp(Persistit.java:1439)
        at com.persistit.CheckpointManager.pollFlushCheckpoint(CheckpointManager.java:271)
        at com.persistit.CheckpointManager.runTask(CheckpointManager.java:301)
        at com.persistit.IOTaskRunnable.run(IOTaskRunnable.java:144)
        at java.lang.Thread.run(Thread.java:748)
WARNING: WARN: [JOURNAL_FLUSHER] WARNING Journal flush operation took 7,078ms last 8 cycles average is 884ms
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 1:17.852s
ERROR: Error during SonarQube Scanner execution
ERROR: Java heap space
ERROR:

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "CLEANUP_MANAGER"
INFO: Final Memory: 40M/989M
INFO: ------------------------------------------------------------------------
The SonarQube Scanner did not complete successfully

我已经更改了 sonar.properties 中的大小,但我仍然面临同样的问题.如何解决这个问题.

I have Changed the size in sonar.properties, still I'm facing the same problem. How to solve this.

sonar.web.javaOpts=-Xmx4G -Xms2048m -XX:+HeapDumpOnOutOfMemoryError
sonar.ce.javaOpts =-Xmx4G -Xms2048m -XX:+HeapDumpOnOutOfMemoryError 
sonar.search.javaOpts=-Xmx4G -Xms2048m -XX:+HeapDumpOnOutOfMemoryError

推荐答案

您更改的是为 SonarQube 本身分配内存的设置.

What you've changed are the settings that allocate memory to SonarQube itself.

您需要更改的是为分析进程分配内存的设置.您还没有说您使用的是哪种分析仪,因此细节会有所不同,但是

What you need to change is the setting that allocates memory to the analysis process. You haven't said which analyzer you're using, so the details will vary a little, but

  • 对于 SonarQube 扫描仪export SONAR_SCANNER_OPTS="-Xmx512m"
  • 适用于 Maven 的 SonarQube 扫描仪export MAVEN_OPTS="-Xmx512m"

这篇关于如何解决 Sonarqube java.lang.OutOfMemoryError: Java heap space的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆