in reply to Catching "out of memory " error

Try not to run out of memory in the first place. Devel::Size will help you estimate.

Makeshifts last the longest.