How to determine if I'm running out of memory