admin 管理员组文章数量: 1086019
I'm working with Excel files that are 20MB+ and contain 100,000+ records. I tried increasing my heap size, but then ran into error "Could not reserve enough space for 2097152KB object heap". Max I can currently set it to is 1GB, but I'm still getting heap memory error.
My code already blows up when I try to read the excel file like this:
try (FileInputStream is = new FileInputStream(new File(excelFilePath));
Workbook newWorkBook = new XSSFWorkbook(is)) {
The part where I'm initialising the workbook, it blows up with the error:
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
So I need to edit the Excel files and add some values. How do I go about this and avoid this memory issue I'm dealing with? If I'm having this memory issue, I don't understand how I'm gonna be able to overwrite the file with the changes I've made.
本文标签: javaHow to edit large Excel file with Apache POIStack Overflow
版权声明:本文标题:java - How to edit large Excel file with Apache POI? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://roclinux.cn/p/1744078390a2529776.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论