log memory usage in case of out of memory error.
log out of memory as a separate exit code.