Attempt to deal gracefully with allocation failures.