Exception in thread "CLEANUP_MANAGER" java.lang.OutOfMemoryError: Java heap space

1,733 views
Skip to first unread message

erb...@gmail.com

unread,
Sep 9, 2016, 11:37:03 AM9/9/16
to SonarQube
Using Jenkins to kick off SonarQube scan


Exception in thread "Report about progress of Javascript analyzer" Exception in thread "CLEANUP_MANAGER" java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
	at java.util.ArrayList.<init>(Unknown Source)
	at com.persistit.CleanupManager.poll(CleanupManager.java:166)
	at com.persistit.CleanupManager.runTask(CleanupManager.java:88)
	at com.persistit.IOTaskRunnable.run(IOTaskRunnable.java:144)
	at java.lang.Thread.run(Unknown Source)
WARN: [JOURNAL_FLUSHER] WARNING Journal flush operation took 11,832ms last 8 cycles average is 1,479ms
Exception in thread "LOG_FLUSHER" java.lang.OutOfMemoryError: Java heap space
	at java.util.ArrayList.iterator(Unknown Source)
	at java.util.Collections$SynchronizedCollection.iterator(Unknown Source)
	at com.persistit.Persistit.pollAlertMonitors(Persistit.java:2285)
	at com.persistit.Persistit$LogFlusher.run(Persistit.java:192)
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
Build was aborted



# Required metadata
sonar.projectKey=XXXXX
sonar.projectName=XXXXXX
sonar.projectVersion=1.0

# Comma-separated paths to directories with sources (required)
sonar.sources="%workspace%"

# Encoding of the source files
sonar.sourceEncoding=UTF-8

#Excludes
#sonar.exclusions=**/*.js
sonar.exclusions=**/*.doc,**/*.docx,**/*.ipch,**/*.pdf

#memory heap
sonar.web.javaOpts= -d64 -Xmx2048m -Xms1024m -XX:+HeapDumpOnOutOfMemoryError -Djava.net.preferIPv4Stack=true -server

erb...@gmail.com

unread,
Sep 12, 2016, 8:37:59 AM9/12/16
to SonarQube, erb...@gmail.com
What am I missing here to stop this error?

Pierre-Yves Nicolas

unread,
Sep 12, 2016, 8:49:43 AM9/12/16
to erb...@gmail.com, SonarQube
Hi Harry,

The analysis fails because it requires more memory than provided.
If you use SonarQube Scanner to analyse your project, you should probably set a value for SONAR_SCANNER_OPTS.

I hope this helps you.

Pierre-Yves

--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/0d4faf3d-0037-4356-93cb-d50544fa357c%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

sasi...@gmail.com

unread,
Jun 23, 2017, 3:09:08 AM6/23/17
to SonarQube, erb...@gmail.com
Hi,

The below work around worked for me for Java Heap Space issue. Hope this helps.

Perform the below steps in Sonar Server


1Install Java 64bit (As my server is on 64bit)

2. Set classpath path in System Variable (Ex: C:\Program Files\Java\jdk1.8.0_131\lib)

3. Add the path C:\Program Files\Java\jdk1.8.0_131\bin at the end in path environment variable for System Variable

4. In sonar.properties file, go to COMPUTE ENGINE section and enable sonar.ce.javaOpts set xmx and xms as needed.

# COMPUTE ENGINE

# The Compute Engine is responsible for processing background tasks.

# Compute Engine is executed in a dedicated Java process. Default heap size is 512Mb.

# Use the following property to customize JVM options.

#    Recommendations:

#

#    The HotSpot Server VM is recommended. The property -server should be added if server mode

#    is not enabled by default on your environment:

#    http://docs.oracle.com/javase/8/docs/technotes/guides/vm/server-class.html

#

sonar.ce.javaOpts=-Xmx2048m -Xms128m -XX:+HeapDumpOnOutOfMemoryError


Start the SonarQube server and check the log at Launch process where the xmx will show half of the value. Compare before and after updating COMPUTE ENGINE

 

Note: Restart required when you add/enable/modify System Variable


Thanks,

Sasi

To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages