Spring Boot Excel Export OOM: Replacing XSSFWorkbook with SXSSFWorkbook and Batch Processing
The author describes how exporting 500k order records caused a 2GB heap OOM, then fixed it by replacing XSSFWorkbook with streaming SXSSFWorkbook, switching from full entity loading to cursor-based batch queries with DTOs, reusing cell styles, and finally decoupling large exports from HTTP requests via async task processing.
