title: How to solve Sonarqube java.lang.OutOfMemoryError: Java heap space
body: <p>I'm using Sonarqube community version. I'm getting the following error,</p>
  
  <pre><code>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
  </code></pre>
  
  <p>I have Changed the size in sonar.properties, still I'm facing the same problem. How to solve this.</p>
  
  <pre><code>sonar.web.javaOpts=-Xmx4G -Xms2048m -XX:+HeapDumpOnOutOfMemoryError
  sonar.ce.javaOpts =-Xmx4G -Xms2048m -XX:+HeapDumpOnOutOfMemoryError 
  sonar.search.javaOpts=-Xmx4G -Xms2048m -XX:+HeapDumpOnOutOfMemoryError
  </code></pre>