Out of memory crash protection