I am not offering this explanation as an excuse but merely as what it is, an
explanation. The main reason HSSF/XSSF are so memory intensive is that a
complete in-memory 'model' of the workbook must be built before it can be
converted into a correctly formatted file when written out to disk. Sadly,
there is no way to build the .xls file incrementally owing to the constaints
of the BIFF8 file format so, typically, the first step is to increase the
amount of memory available to the jvm using the -X switches.

Having said that, can I ask what it is you are doing? Are you simply
creating a sheet full of numbers? Is the formatting applied to the cells
important - do you need to see negative numbers coloured red for example? Do
you create formulae and add them to the sheet to perform calculations for
you? Do you require labels at the top of the columns/beginning of each row?
If not, then you could think about creating a .csv file using core java code
and then relying on Excel's import feature to bring the data into a
worksheet for you.

Just as an aside, can I ask what you mean by "an excel document stream from
a file"?


vince_neil wrote:
> 
> I am experiencing this issue.  I am creating an HSSFWorkbook with an excel
> document stream from a file, but it takes more than an hour for the
> HSSFWorkbook to be created, and it crashes before it can finish due to
> java heap space running out of memory!
> 
> The file is 24 megabytes, and simply consists of thousands of rows with
> whole numbers in each cell.  There are tens of thousands of rows.  Is POI
> really slow and inefficient?  Is there a way to fix this problem?  One
> would think that an HSSFWorkbook, even with the number of rows and cells I
> am dealing with, could be instantiated much faster than this!  Please help
> if you know what the problem is.
> 

-- 
View this message in context: 
http://www.nabble.com/Urgent%3A%3APOI-is-too-slow-for-generating-excel-for-more-than-60000-rows-tp17646122p23665402.html
Sent from the POI - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to