Better system for dealing with running out of memory.