search cancel

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

book

Article ID: 185973

calendar_today

Updated On:

Products

Clarity PPM On Premise Clarity PPM SaaS

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 JVM is set to 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

Cause

The JVM set up on the server should be set correctly for a Production environment. It's recommended to have 10-20GB of JVM assigned on a Production server.

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

Resolution

Increase JVM on the server


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.

 

GC handling is not optimal 

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.

 

1. Add -XX:-UseGCOverheadLimit to the JVM parameters and then restart. This should resolve the problem.