This error is thrown when the JVM cannot allocate an object because it is out of memory, and no more memory could be made available by the garbage collector.
The application servers in WebSphere run as separate JVMs or Java processes. So the process itself dies.
One should never try to catch such an error as generally it is almost impossible to recover from it. You will have to do some serious analysis to identify why this is happening.
Joined: Jan 10, 2010
Thanks for the reply,
I was looking for a way to dynamically prevent OOME.
I wanted to implement an 'OutofMemoryERROR Warning System' as described in OOME Warning System,
but in stead of reacting to a pending OOME by increasing the PercentageUsageThreshold (at runtime), I wanted this system to find the culprit thread (which was allocating all these objects) and 'kill it'.
Is this feasible ?
Joined: Feb 13, 2004
I am not very +ive about developing such a thing. I would rather focus on writing code that avoids out of memory issues. I have seen cases where the issue was in the underlying JRE instead of the application code. Based on app server you can work with the app server vendor or JRE vendor. Monitor GC logs and nail down the issue.
But do post a solution in case you develop something innovative.
subject: Why does OutOfMemoryError cause Appserver to crash rather than just the application ?