Jaspersoft fails with java.lang.OutOfMemoryError: GC overhead limit exceeded

book

Article ID: 185973

calendar_today

Updated On:

Products

Clarity PPM On Premise

Issue/Introduction

Jaspersoft goes down with error message:

2020-03-02 10:00:43,434 ERROR SystemErrorController,https-openssl-nio-8443-exec-10:83 [myorg|myuser] - Internal server error org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.OutOfMemoryError: GC overhead limit exceeded

 

Checking the the setenv.bat files in $tomcat/bin we can see the default settings:

set JAVA_OPTS=%JAVA_OPTS% -Xms1024m -Xmx2048m -XX:MetaspaceSize=32m
set JAVA_OPTS=%JAVA_OPTS% -Xss2m -XX:+UseConcMarkSweepGC
set JAVA_OPTS=%JAVA_OPTS% -XX:+CMSClassUnloadingEnabled

Environment

Release : All Supported Clarity releases with Jaspersoft

Component : Jaspersoft

Resolution

This problem is having two causes:

FIRST: The JVM you have set up on the server is too small for a Production environment, you should consider increasing this. For information, in our SAAS environments, we have 20GB of JVM assigned.

Recommendations:
1. Check on this server to see how much available RAM there is. Make sure you account for OS RAM etc.

  1. Once you established how much RAM you can safely assign, bring the Jaspersoft server down
  2. Modify the setenv.bat and set the new values in. For example:

-Xms2048m -Xmx10240m

  1. Restart the Jaspersoft server.

 

For you the problem comes from the fact that GC does not properly work on a small heap. It has to recover at least 2% and it can't, see below:  

https://www.oracle.com/technetwork/java/javase/gc-tuning-6-140523.html#par%5Fgc.oom

Excessive GC Time and OutOfMemoryError

The parallel collector will throw an OutOfMemoryError if too much time is being spent in garbage collection: if more than 98% of the total time is spent in garbage collection and less than 2% of the heap is recovered, an OutOfMemoryError will be thrown. This feature is designed to prevent applications from running for an extended period of time while making little or no progress because the heap is too small. If necessary, this feature can be disabled by adding the option -XX:-UseGCOverheadLimit to the command line.

 

SECOND: Because of this, please also add -XX:-UseGCOverheadLimit to the JVM parameters and then restart. This should resolve the problem.