0

Quartz Scheduler throws java.lang.OutOfMemoryError: GC overhead limit exceeded

Caused by: java.lang.OutOfMemoryError: GC overhead limit exceeded
    at com.mysql.jdbc.SingleByteCharsetConverter.toString(SingleByteCharsetConverter.java:327)
    at com.mysql.jdbc.ResultSetRow.getString(ResultSetRow.java:819)
    at com.mysql.jdbc.ByteArrayRow.getString(ByteArrayRow.java:70)
    at com.mysql.jdbc.ResultSetImpl.getStringInternal(ResultSetImpl.java:5816)
    at com.mysql.jdbc.ResultSetImpl.getString(ResultSetImpl.java:5693)
    at com.mysql.jdbc.ResultSetImpl.getString(ResultSetImpl.java:5733)

Our application has 1.5GB of heap space, But it still throws it. I did profiling and couldn't find any leak in our code. Please help me to resolve this

Selvakumar Ponnusamy
  • 5,363
  • 7
  • 40
  • 78

2 Answers2

0

This is most likely caused by a memory leak in your application. Please refer to this post for details as to what causes your GC error message. Simply put, your app is running out of heap space and the GC is trying too hard to free some space until it gives up because the JVM spends way too much time doing GC rather then doing other "useful" things.

I suggest that you generate a heapdump from your running JVM and analyze it with one of the JVM heap analysis tools available (e.g. Eclipse MAT is very good). You can use jconsole to monitor your JVM heap usage and take the heapdump at some point shortly before the JVM heap is all used up.

Community
  • 1
  • 1
Jan Moravec
  • 1,808
  • 1
  • 15
  • 18
-1

The “java.lang.OutOfMemoryError: GC overhead limit exceeded” error will be displayed when your application has exhausted pretty much all the available memory and GC has repeatedly failed to clean it. You can try by giving more memory to the process. Again this is as easy as adding (or increasing if present) just one parameter in your startup scripts:

java -Xmx1024m< com.yourcompany.YourClass/code>

Or you can go ahead and try out Plumbr for free. When we find the cause for the java.lang.OutOfMemoryError you will see the exact location of the problem along with solution guidelines.