// Process in chunks (works fine)
for each 500 records:
- Fetch data
- Convert to CSV
- Store as chunk-N.csv in R2
// Combine chunks (fails with OOM)
for each chunk:
- Download chunk from R2
- Append to temp file
- Re-upload temp file
// Memory grows with each iteration
// Process in chunks (works fine)
for each 500 records:
- Fetch data
- Convert to CSV
- Store as chunk-N.csv in R2
// Combine chunks (fails with OOM)
for each chunk:
- Download chunk from R2
- Append to temp file
- Re-upload temp file
// Memory grows with each iteration