Also, lack of memory does not necessarily mean what you think. Severe memory fragmentation due to over-creation of an object can be recorded both out of memory, as the GC cannot find a contiguous block of memory large enough for the next (or last) location.
source
share