Out of memory workaround