Deployment fails due to "java.lang.OutOfMemoryError: GC overhead limit exceeded"

Deployment fails due to "java.lang.OutOfMemoryError: GC overhead limit exceeded"

book

Article ID: KB0073710

calendar_today

Updated On:

Products Versions
TIBCO Administrator 5.11.x,5.10.x ,5.9.x,5.8.0

Description

Issue:
Deployment from Administrator GUI or AppManage can fail with Exception in thread "main" java.lang.OutOfMemoryError: GC overhead limit exceeded

Description:
According to Oracle JAVA , the error happens "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.".

Solution:
Apparently, one could use the command line to pass arguments to the JVM for
  • Increasing the heap size, via "-Xmx1024m" (or more). 
or
  • Disabling the error check altogether, via "-XX:-UseGCOverheadLimit".

Issue/Introduction

We see deployment failed due to "java.lang.OutOfMemoryError: GC overhead limit exceeded"

Environment

Product: TIBCO Administrator Version:5.11.x,5.10.x ,5.9.x,5.8.0

Resolution

Add the following properties to the tibcoadmin<DomainName>.tra file. Similarly, if the deployment is failing from AppManage then add the following properties to AppManage.tra.

Step 1:

For Java 8 (applicable for TRA 5.11.x/5.10.x):
NOTE: in Java 8 MaxPermSize has been deprecated and will be ignored, customer will have to use 
MaxMetaspaceSize (-XX:MaxMetaspaceSize=128m)
 
We need to append GC tuning properties 
#Give some extra space to metaspace if needed.
java.extended.properties=-XX\:
MaxMetaspaceSize\=128m   -Xincgc -XX:NewSize=128m -XX:MaxNewSize=256m 


For Java 7 (applicable for TRA 5.9.0/5.8.0) : 

java.extended.properties=-Xincgc -XX:NewSize=128m -XX:MaxNewSize=256m -verbose:gc

For e.g by default  in tibcoadmin_<DomainName>.tra file we have 
#Give some extra space to permgen if needed.
java.extended.properties=-XX\:MaxPermSize\=128m 
We need to append GC tuning properties 
#Give some extra space to permgen if needed.
java.extended.properties=-XX\:MaxPermSize\=128m   -Xincgc -XX:NewSize=128m -XX:MaxNewSize=256m 
 
NOTE: we can -verbose:gc   but this parameter is optional and only required to troubleshoot and capture GC logs 

Step 2:

Please also review your max heap setting in this tibcoadmin_<DomainName> tra file, to address the above error we will have to tune java.heap.size.max

For e.g. tune the following parameters 
#Specifies the min and max Java heap size to allocate.
java.heap.size.initial=512M
java.heap.size.max=1024m


Step 3:
This step is required only if Step 1 and Step 2 fails to resolve the issue, in tibcoadmin_<DomainName>.tra file we can add the following property to disable GC Overhead limit
For Java 8 (applicable for TRA 5.11.x/5.10.x):
java.extended.properties=-XX\:
MaxMetaspaceSize\=128m -XX:-UseGCOverheadLimit

For Java 7 (applicable for TRA 5.9.0/5.8.0) : 

java.extended.properties=-XX\:MaxPermSize\=128m -XX:-UseGCOverheadLimit
 

Additional Information

Please see the below links for more details on this Java error:
http://stackoverflow.com/questions/5839359/java-lang-outofmemoryerror-gc-overhead-limit-exceeded

https://dzone.com/articles/java-8-permgen-metaspace

https://archenroot.wordpress.com/2015/03/24/java-8-xxpermsize-and-xxmaxpermsize-disappearing/