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 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.