0

In the server, we have >4GB free RAM but instead we have facing the following error code on that server. And also I knew the error means that the GC(Garbage Collector) tried to free memory but was pretty much unable to get anything done. By default it happens when the JVM spends more than 98% of total time in GC and when after GC less that 2% of the heap is recovered.

So, how can we handle with the issue on the server or may be Tomcat server. Please suggest me. Thanks

Status Code: 500
Message: Handler processing failed; nested exception is java.lang.OutOfMemoryError: GC overhead limit exceeded
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/600.7.12 (KHTML, like Gecko) Version/8.0.7 Safari/600.7.12
Exception: java.lang.OutOfMemoryError: GC overhead limit exceeded
puru
  • 266
  • 5
  • 13
  • What are your JVM memory settings, what is the system memory? – Michael Jul 10 '15 at 09:08
  • possible duplicate of [Error java.lang.OutOfMemoryError: GC overhead limit exceeded](http://stackoverflow.com/questions/1393486/error-java-lang-outofmemoryerror-gc-overhead-limit-exceeded) – Michael Jul 10 '15 at 09:10

1 Answers1

0

As you rightly pointed out that Garbage collector is spending 98% of time and GC and able to recover only (or less) 2% of the heap space. This looks to be case of objects are getting allocated on the heap very fast. You can take a heap dump and analyze using EclipseMemoryAnalyzer to check what objects are getting allocated on the heap. This should be a problem in the code rather than with Tomcat (or your application needs more heap size).

Vishik
  • 23
  • 2