Summary: | when invoke method XSSFWorkbook workbook = new XSSFWorkbook(File file) ,java.lang.OutOfMemoryError: Java heap space occurred | ||
---|---|---|---|
Product: | POI | Reporter: | younger <liuyang19870120> |
Component: | XSSF | Assignee: | POI Developers List <dev> |
Status: | RESOLVED INFORMATIONPROVIDED | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | 5.2.3-FINAL | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | All | ||
Attachments: | The excel file mentioned above |
Description
younger
2023-05-22 02:09:08 UTC
Created attachment 38564 [details]
The excel file mentioned above
Reading a large xlsx file requires a lot of memory. Try increasing your Xmx size. There is also support for streaming the Excel data - see https://poi.apache.org/components/spreadsheet/how-to.html and the 'XSSF and SAX (Event API)' section in it. There are external libs for stream reading that might be easier to use: * https://github.com/pjfanning/excel-streaming-reader * https://github.com/dhatim/fastexcel |