2

We have configured new server for our java applications and deployed one of the applications which runs on java. After a week we received error java.lang.OutOfMemoryError: GC overhead limit exceeded, we restarted service and it was working fine later after 1 more week we received same error again.

This service was running earlier in another server which was having less configuration than the new one.

We never encountered this error in the old server.

This service runs with jre provided with the software.

"%JAVA_HOME%\bin\java" -server -Xms256M -Xmx256M,

Does increasing values of Xms and XmX will resolve GC Overhead limit problem.

Swami M
  • 21
  • 2
  • 1
    That smells suspiciously of memory leak. Likely if you increase your available memory for the JVM you'll simply extend the timeline in which that error repeats itself. – WillBD Apr 11 '14 at 14:59
  • @MatthewWilson Did you use the flag button to indicate that? I couldn't see the flag when I tried to close. – Duncan Jones Apr 11 '14 at 15:02
  • 1
    @Duncan seems I am a bit of a noob, didn't realise I could flag it, flagged now – Matthew Wilson Apr 11 '14 at 15:06
  • See my comment to *WillBD* below. You need to understand what your application is doing: what object it's holding and why, and why it's running GC so much. In the past, I've seen this error with an application that had a large cache and high message volume. In *that* case, increasing available heap was a valid solution. But your situation may be different. – kdgregory Apr 11 '14 at 15:26

1 Answers1

3

To answer the actual question in your question, yes, increasing those values will temporarily solve the GC Overhead problem. But instead of seeing that mysterious error one a week, you might see it once a month, or once every other month.

This type of behaviour is incredibly indicative of having a memory leak in java. "But I thought you couldn't have memory leaks in java?" wrong. It's somewhat difficult to create a c/c++ type-memory leak in java, but it's certainly possibly to duplicate the behaviour, and the same unfortunate effect, in java. see Creating a memory leak with Java for more information on that.

I highly recommend re-assessing what's going on in that program that's causing the GC overhead limit, and address it there.

Community
  • 1
  • 1
WillBD
  • 1,919
  • 1
  • 18
  • 26
  • "GC overhead limit" rarely indicates a memory leak. Usually it indicates a large steady-state allocation, with high rates of object creation and collection. – kdgregory Apr 11 '14 at 15:24
  • Although usually I would agree, because it's happening on such a strict timeline (almost exactly a week) It's very likely that some extra steps need to be taken to ensure objects are being collected quickly and efficiently. If his application is outrunning the GC in a week now, the chances are strong that it will continue to outrun it until some optimization occurs. thus the 'leak' type behaviour. – WillBD Apr 11 '14 at 15:33