开发者

How to store directly data in Apache POI XLS?

I use Apache POI HSSF API for Java to generate a long long report as XLS file. The problems is dat开发者_如何学编程e is really large and my memory fails before calling wb.write(out);. So I wonder if there is some way directly or periodically to store the information for the XLS report.


You could try using the latest version of POI 3.8 beta and look into the SXSSF model, I'm know they are trying to help memory usage when reading in from an xlsx, but I'm not sure how it would work with writing out. Might be worth a look though.

Other than that I think you're only option is to up the heap space for your JVM by using -Xmx.

I hope this helps!


you need to close the workbook object.. ensure that its out of scope & reopen the document again.. it might help to call System.gc() after closing the document.

its best to increase the max memory (heap space) allocated to java for better results.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜