Should we do some explicit error handling (throwing OutofMemoryError, etc) here?