Made sure not to attempt in logging the exception if it is an out of memory one. It's better to not log it than not allow the system to terminate 'normally' by using up whatever is left