Pivotal Knowledge Base


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


Pivotal Cloud Foundry Java buildpack


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

java.lang.OutOfMemoryError: GC overhead limit exceeded


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.


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.


Powered by Zendesk