POI 堆空间异常或 Excel 2007 的任何替代 java api?
我一直在寻找这个问题的解决方案,但没有找到任何好的 =(
所以问题是我需要创建一个最多 50.000 个寄存器的 excel 文件,当我这样做时,在 50.000 个应用程序寄存器处显示此错误:
据我所知,解决这个问题的一种方法是增加堆
内存,但我不太喜欢(急救),因为如果文件变大并且服务器冻结并消耗,问题仍然存在大量内存尝试执行此操作并且速度很慢,
我认为解决方案是写出 excel 文件,而不是将数据保留在堆内存中,但我没有得到
任何想法? 或 excel 2007 的另一个框架文件???????
i've been searching around for a solution for this problem and haven't found anything good =(
so the problem is i need to create an excel file up to 50.000 registers and when i do this show me this error at 50.000 app register:
java heap space
as far as i'm looking on, one way to solve this is increasing the heap memory, but quite don't like me (first aids) because the problem persist if the file gets to bigger and the server freezes and comsume a lot of memory trying to do this and gets slow
i think a solution would be writte out the excel file instead of leaving the data in the heap memory, but i don't get it work
any ideas ?? or another framework for excel 2007 files ???????
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
调用
HSSFWorkbook
上的write()
方法将 Excel 工作簿保存到文件中:但如 此线程 表示无法对 POI 中的文件进行流式写入。 POI 的替代品是 jXLS (开源)或 Aspose.Cells for Java(专有)
Call the
write()
method on yourHSSFWorkbook
to persist your Excel workbook to a file:But as this thread indicates there's no way to do streaming writes to file in POI. Alternatives to POI are jXLS (open source) or Aspose.Cells for Java (proprietary)