Resolving java.lang.OutOfMemoryError, "GC overhead limit exceeded" in Pivotal Cloud Foundry
search cancel

Resolving java.lang.OutOfMemoryError, "GC overhead limit exceeded" in Pivotal Cloud Foundry

book

Article ID: 297860

calendar_today

Updated On:

Products

VMware Tanzu Application Service for VMs

Issue/Introduction

Symptoms:

Your Java or Spring app is crashing and the app logs indicate the following error:

java.lang.OutOfMemoryError: GC overhead limit exceeded

Environment


Cause

The "java.lang.OutOfMemoryError: GC overhead limit exceeded error" is the JVMs way of signaling that an application spends too much time doing garbage collection with too little result. By default, the JVM is configured to throw this error if it spends more than 98% of the total time doing GC and after the GC only less than 2% of the heap is recovered.

Resolution

This error doesn't directly indicate memory is insufficient. However, it is originally caused by a lack of memory because that's what triggered the GC. You can resolve the problem by adding more to your app.

You can run cf scale -m or when pushing an app to Cloud Foundry, append -m <memory> to cf push with a larger memory size.