There is an issue with the JNI interface where if you define an object, its
not automatically marked as garbage. This is because you're programming in
RPG, not Java. There are a couple things you can do, which include marking
the object itself as obsolete, or you can define a start and end point,
where anything created within that point range is marked as garbage for the
collector.
Here are some code examples. I think these routines are in the base
service tool from Scott Klement, but we have modified them, so I don't
remember for sure:
callp hssf_begin_object_group(100);
callp hssf_end_object_group();
SS_freeLocalRef(TempStr);
One other thing you'll notice. If you're building a 50,000 row
spreadsheet, you're going to be using a lot of the available heap memory
anyway. If this becomes an issue, we switched a lot of our generation to
the SXSSF method of routines. This does require creating a couple more
java prototypes, but it allows you to create a spreadsheet of almost
unlimited size. The downside to this streaming method is that you can't
refer back to previous rows within your code...at least not very far back.
From: "Darryl Freinkel" <dfreinkel@xxxxxxxxxxxxxxxxx>
To: <rpg400-l@xxxxxxxxxxxx>
Date: 11/17/2015 09:14 AM
Subject: Do we need to do Garbage collection when using the POI classes
from the HSSF4 service program?
Sent by: "RPG400-L" <rpg400-l-bounces@xxxxxxxxxxxx>
I am using Scott Klement's code to read some large spreadsheets some with
over 50,000 rows.
I have had an issue with one program that led me to think about garbage
collection. I do not see any reference to it in Scott's notes so I am
asking
for confirmation.
I think I saw somewhere in the code but cannot find it again.
Do I need to do anything to take care of the garbage collection?
Darryl Freinkel
Assignment 400 Group, Inc.
Tel: 770.321.8562 ext 111 | Fax 770.321.8562 | 2247 La Salle Dr, Marietta
GA, 30062, USA | PO Box 72556, Marietta, GA 30007-2556
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at
http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.