R-friendly out-of-memory handling