Our Java application (uses SWing,net and other standard packages)suddenlty quits with out a trace. We are aware of the fact that we are facing OutOfMemory probelm. Does java guarantee that OutOfMemory error will always be logged? Or is it possible that the application will quit with out logging OutOfMemory error due to non-availablity of memory even for the log action?
Hi, According to my experience, we cannot do anything when JVM raises OutOfMemory error. The application will quit automatically and we can see the stacktrace about that error..
Correct me if I am wrong... daniel
sarveswaran meenakshi sundaram
Joined: Nov 04, 2004
Thanks for the replies.
I'm getting in to the details. In our application, when ever an exception occurs, we capture it, open a file, log the exception in the file, then close the file. When OutOfMemory error occurs, is it guranteed that all the actions that I have specified here will occur so that the exception is logged in our exception file? Or is it possible that the application may quit with out logging the exception in the file due to the non availablity of memory for the set of we have follow to log exceptions in our file?
Second, trying to respond to OutOfMemoryError is difficult. It can happen at any time, so your data structures may be broken. Also, if your attempt to handle OutOfMemoryError tries to allocate memory (e.g. write to a log file), then that may cause another OutOfMemoryError.
Third, various versions of the JVM have various bugs that mean that OutOfMemoryError does not always get thrown, when it ought to. Sometimes, the JVM crashes or exits instead.
Lastly, the JVM can run occasionally out of other memory-type resources than Java heap. This can cause various problems.
Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.