OutOfMemory exceptions
JVMs throw OutOfMemory exceptions when they cannot find enough space for a new object allocation request.
From our experience, OutOfMemory exceptions are primarily due to the following reasons:
- The JVM heap does not have enough total free space in the heap for the new object, or
- In the case of IBM® JVMs, the heap may have enough total free but not enough contiguous free space for the new object.
The JVMs try to recover gracefully when OutOfMemory exceptions occur - unfortunately, the outcome of the recovery can be unpredictable. We have seen situations where threads have disappeared (they don't show up in the thread dumps), threads have gone into infinite loops, or database connections from failed threads remain opened and in some cases, hold on to record locks.