On Sun, 30 Oct 2011 01:56:23 +0300, Timon Gehr <[email protected]> wrote:

You could use catch(Error err) or catch(OutOfMemoryError err) or not catch the Error at all.

Note that (IIRC) an OutOfMemoryError will be thrown only when:
1) There is no space on the managed heap
2) A garbage collection cycle failed to free enough memory for the requested allocation
3) The operating system could not allocate any more memory, even from swap.

Some operating systems (Windows) will even expand the swap file automatically when it nears being full.

I don't think that there's any point in doing anything sensible in an OutOfMemory handler.

--
Best regards,
 Vladimir                            mailto:[email protected]

Reply via email to