Closes #428 by catching OutOfMemoryError, logging, and rethrowing it.