Pivotal Knowledge Base

Follow

java.lang.OutOfMemoryError: "GC overhead limit exceeded"

Environment

Pivotal Cloud Foundry + Java buildpack

Symptom

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

java.lang.OutOfMemoryError: GC overhead limit exceeded

Cause

The java.lang.OutOfMemoryError: GC overhead limit exceeded error is the JVM’s 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.

Comments

Powered by Zendesk