Warren Acker wrote:

I'm new to HSSF, so forgive me if this is a stupid question.  I'm
attempting to copy a result set from a very large DB2 UDB for iSeries table
into a workbook with multiple sheets, and I'm running out of memory.
From what I see, the write method is only on the workbook, and it requires
me to have the sheets already "populated" and sitting in memory.

No its a disadvantage of the file format. Basically it has upstream pointers to downstream things so in order to, for instance, write the workbook header, we have to know where each sheet will be (byte offset) . And the OLE 2 CDF file format the its embedded in is even worse (think structure of the FAT filesystem, its not streamable because you have to know WHERE you're going to write a file before you can send the file allocation table over)...

Is there a recommended technique to get around this?

Well I keep going back and forth and then end up with "it is the right decision not to do this yet"...

Basically HSSF uses a lot of memory because every value is represented as an object. I've got a refactored version that uses primitive values in parrallel arrays (performance is increased as well as memory consumption is SIGNIFICANTLY reduced...by like 75%). I plan to commit this code after the 2.0 release for the POI 3.0 development tree. The trouble is that it makes debugging HSSF WAY more difficult. Like by a factor of 3 or so. Which means it would slow down the development of Graphing and Formulas. I don't want to release this code publically until I'm ready to commit it to POI because I don't want to have to support a forked version.

In the mean time, SuperLink is working on a commercially supported and enhanced version of POI called SOA Workbook with the ever talented Christopher Tomschuetz which uses his proprietary formula calculation engine. It will feature the POI 3.0 memory model and we'll offer support of course.
So I guess your options are:
1. use Java -Xmx to increase heapsize
2. wait for POI 3.0 development to start
3. wait for SOA Workbook 1.0 to come out (December)

Hope that helps,

-Andy

********************************************
Warren P. Acker
IBM Corporation, Rochester MN Bldg 015-3 Dept. X8X
External phone: (507) 253-7806. Internal phone T/L 553-7806



--
To unsubscribe, e-mail: <mailto:poi-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:poi-user-help@;jakarta.apache.org>





--
To unsubscribe, e-mail:   <mailto:poi-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:poi-user-help@;jakarta.apache.org>

Reply via email to