Regenerate data in batches to keep memory consumption down