OutMemoryError Logging

Dear all,

In our application,every time an exception is thrown, we capture it, open a file, log the exception in the file, then close it. When outOfMemory error occurs, will it be captured and logged in the file for sure? Or is it possible for the exception not to be logged since the application is running out of memory. We have seen the OutOFMemory log in our exception file. But can we say for sure the sequence of actions for logging the exception will always occur even when out of memory occurs ?

[517 byte] By [sarveswaran_m] at [2007-9-30 21:51:29]
# 1

The OutOfMemoryError is a Throwable, and it causes the termination of the thread causes this Error, but it's not thrown by the application, the JVM itself throws it. you can catch it and guarantee the catch block to execute, sinc it's Throwable (By the Java specs.). But it's not recommended to be caught coz it's an Error that must be handled at the development-time rather than at the run-time.

MohdSleem at 2007-7-7 3:19:58 > top of Java-index,Administration Tools,Sun Connection...