2

Can java server survive after below errors

java.lang.OutOfMemoryError:

Java heap space java.lang.OutOfMemoryError: GC overhead limit exceeded

In my application i got heap dump after this error still I see some logs getting printed after this error also. Not able to understand how it is survived after Error.

Vipin
  • 4,851
  • 3
  • 35
  • 65
  • Could you please post the logs? Where are the logs coming from your application or the JVM itself? – JasonSec May 14 '14 at 18:12
  • [This](http://www.javacodegeeks.com/2013/08/understanding-the-outofmemoryerror.html) has some useful info on that specific error (look at third note) . Also, [this](http://stackoverflow.com/questions/1393486/error-java-lang-outofmemoryerror-gc-overhead-limit-exceeded) is a related question (possibly duplicate?) – But I'm Not A Wrapper Class May 14 '14 at 18:30

1 Answers1

2

Yes -- it is possible to survive an OOM exception, but you likely lost a thread in the process. Once that thread died, all memory that it was holding on to got GC'd and you continued to run.

I'd never advise relying on this behavior though because you can't guarantee which thread is going to die.

Alcanzar
  • 16,985
  • 6
  • 42
  • 59