Потоковый экспорт больших файлов без OOM
engineering
streaming-export-safety is a Claude Code skill that prevents out-of-memory errors, temporary file leaks, and HTTP thread blocking when exporting large datasets to Excel, CSV, JSON, and PDF formats. It activates on files matching patterns like Export, Excel, Report, Download, Backup, and Writer across Java, Python, Go, TypeScript, and JavaScript. The skill defines clear thresholds: streaming APIs become mandatory above 10,000 rows or 10 MB, and are required without exception above 100,000 rows or 50 MB. Four specific traps are addressed with before-and-after code: XSSFWorkbook full in-memory loading replaced by SXSSFWorkbook with dispose(), CSV bulk readAllLines replaced by BufferedReader line iteration, Jackson writeValueAsString replaced by JsonGenerator streaming with JSONL as an alternative format, and full PDF pre-rendering replaced by per-page flush using iText or ReportLab. Language-specific APIs are covered for each format.
- #excel-export
- #streaming
- #memory-safety
- #csv
- #pdf-generation