Four Stars

[resolved] Solution for "java.lang.OutOfMemoryError: GC overhead limit"

Recently I came across this OOM error while processing flat files on the machine with 16 GB of RAM and Talend configuration was Xmx1024m. By adding following clause in settings, this issue was solved without increasing memory.
Add new option to Windows-->Preferences-->Talend-->Run/Debug  - XX:-UseGCOverheadLimit
Thanks
Vaibhav
3 REPLIES
Seventeen Stars

Re: [resolved] Solution for "java.lang.OutOfMemoryError: GC overhead limit"

Here the list of all options:
http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html
I would suggest to check or profile the job because a batch job processing data row by row should not allocate so much memory.
One Star

Re: [resolved] Solution for "java.lang.OutOfMemoryError: GC overhead limit"

Hi,
I used following one as Vaibav said above
Add new option to Windows-->Preferences-->Talend-->Run/Debug  - XX:-UseGCOverheadLimit
Now getting error as
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
How could I resolve it?
Please anyone provide the solution to me. Any suggestions would be appreciated.
Thank you,
One Star

Re: [resolved] Solution for "java.lang.OutOfMemoryError: GC overhead limit"

Curing this error via adding -XX:-UseGCOverheadLimit is just masking the symptoms and not solving the underlying problem. The problem is that when failing with the “java.lang.OutOfMemoryError: GC overhead limit exceeded” error JVM is signalling that your application is spending too much time in garbage collection with little to show for it. By default the JVM is configured to throw this error if you are spending more than 98% of the total time in GC and after the GC less than 2% of the heap is recovered.
As a quick fix, increasing the heap size with -Xmx parameter can help, but I can recommend to read the more detailed OutOfMemoryError cheat sheets by both GC overhead limit exceeded and Java heap space errors from https://plumbr.eu/outofmemoryerror