poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Denis Pimenov <k...@bitel.ru>
Subject Re: java.lang.OutOfMemoryError: Java heap space
Date Mon, 15 May 2006 07:17:59 GMT
LiuGuoMing wrote:

>java.lang.OutOfMemoryError: Java heap space
>I'm currently using POI to generate some fairly large Excel files 
>(30,000+ rows), using the org.apache.poi.hssf.usermodel package. 
>it occur 'java.lang.OutOfMemoryError: Java heap space' when run it. 

>Why?How to solve it?
I have already faced with that problem. And i haven’t found solution for 
it. The trouble is in implementation of java language and poi . Big 
excel file consists of great number of little structures and size plenty 
of them is about 1 - 8 bytes. Poi creates java object for each 
structure. Empty java object in sun implementation has size of 8 bytes. 
An object with 1-byte field is aligned to 16 bytes, 4 - bytes to 16, 9 
bytes to 24 and etc. This lead to that : poi reads a documents with size 
of 45 Mb(about 3000 000 objects), but poi object has size of 700 Mb.

I have solved that problem for reading with using "poi event based api" 
. I have read only data and placed it in lists. This decreased object's 
size from 700 to 160.
But still i don't know solution for file generation. I even think that, 
may be, poi developers can't help you.

To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/

View raw message