开发者

Java POI HSSF Memory Handling Question

开发者 https://www.devze.com 2022-12-12 04:46 出处:网络
I have a design question on how to design parsing a large excel file say 1000 x 100 Rows, and about 10 tabs.

I have a design question on how to design parsing a large excel file say 1000 x 100 Rows, and about 10 tabs.

Each Tab having a set of records with primary key as the first col. but these could be repeted in different tabs and each does not have the sam开发者_JS百科e set of primary keys.

  1. Read a single primary key and form a java object with all the attributes spread across multiple tabs.

  2. Read tab by tab, and process the record

In terms of how Memory is handled in HSSF Java API.

Thanks in Advance


I have an app that does almost exactly your option 1. You'll need about 500M of ram for the VM for it to run at all well. And its not super fast, but it works.

I'd therefore go for option 2. ( refactoring to cache tabs parse results has improved performance.

I'd recommend to stop using HSSF objects as soon as you can so they can be garbage collected.

0

精彩评论

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

关注公众号