Check for memory errors, kill the program if out of memory