× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Darren,
There are basically two issues here.

One is that an HSSFWorkbook is stored entirely in memory until you
invoke the write method. The write method creates a new
POIFSFileSystem object on the write, so you don't want to constantly
be invoking the write method. Also for each cell you are creating a
new object. Most likely for each new value you place in the cell you
are creating a new object as well. As you can see that's a lot of
objects created.

The second, as Dan points out, is that RPG does not natively perform
GC. You have to use JNDI to clean up objects that RPG creates. So all
those new strings, cells, rows, formats, etc are all objects that
don't get garbage collected.

I don't know if you know or are allowed to use Java, but I think it's
an easier approach to just create a Java program to create the
spreadsheet. If you don't need anything fancy, a CSV works much
better. The cleanest and least memory intensive would probably be to
use Microsoft's XML format. The problem with that is it's probably the
most complicated to use or at least start with :-)

--
James R. Perkins



On Tue, Mar 2, 2010 at 06:40, <darren@xxxxxxxxx> wrote:

I'm using the HSSF POI API's, via Scott Klement's service programs, to
generate a rather large spreadsheet.  It has two tabs with about 20K rows,
and I've come to accept that it will take a little while to run.  However,
as I watch my job, I see 'Temporary Storage Used' go as high as 600MB.
I've studied the service programs, as well as my own code, to make sure
that I'm freeing local references to objects whenever I'm done with them.
Is this normal behavior for these API's with a larger spreadsheet, or do I
have a memory leak somewhere?

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.