Published on Dec 2 2011 in Java

'GC overhead limit exceeded' is another kind of error that can occur when hosting your Java application on external Java host running JVM with different heap settings than your development environment.

What documentation says: 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.

Common solutions in this case are:

You may also try to change Garbage Collector Policy with -XX:+UseConcMarkSweepGC concurrent (low pause time) garbage collector (also known as CMS), or -XX:+UseParallelGC parallel (throughput) garbage collector.

References / See also: Tuning Garbage Collection with the 5.0 Java TM Virtual Machine 4 Easy Ways to do Java Garbage Collection Tuning Java Tuning White Paper GC overhead limit exceeded - Java Heap analysis