Hi,
you can try to catch Trowable instead of catching Exception (OutOfMemoryError is an error, not an exception).
You have to be cautious if you are using Swing or any other multi-threaded application - I was once trying to catch OutOfMemoryError within the static main() method, but the OutOfMemoryError was created on the Swing thread.
If using Swing you might consider to use catch(Throwable) in each actionPerformed method as a last resort, e.g.
public final void actionPerformed(ActionEvent e) {
try {
doSomething();
} catch(SQLException ex) {
displaySQLERror(ex);
} catch(Throwable ex) {
displayUnknownError(ex);
}
}