Handle low memory conditions

Handle a variety of memory error conditions.