Oops, I hadn't read Adam's clarification that he'll catch the
out of memory exception in an outer scope; in this case, it should
indeed work, if the VM is structured to set aside the resources
necessary to process and catch the exception.
Unlike Jon, I don't think that stack space is an issue. The problems
are twofold: first, the out of memory error object must have been
preallocated (cause you can't allocate it when you need it), and secondly
and more importantly, the VM must wait to throw it when it is "safe".
For instance, it cannot simply throw the exception in the middle of
manipulating an important VM data structure because an abrupt termination
might leave that data structure in an inconsistent state (it may leave
a class half-loaded or processed.
I'd be interested in hearing people's experiences with throwing and
handling out of memory exception with Apache's Sun's JDK, btw. How often
does it work? Can you catch it in an outer frame, gc, and continue?
Can you let the thread terminate and gc and continue? How
often does the VM crash if you do that? What experiences do people
have here?
- Godmar
----------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
READ THE FAQ!!!! <http://java.apache.org/faq/>
Archives and Other: <http://java.apache.org/main/mail.html/>
Problems?: [EMAIL PROTECTED]