× 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.




Hi Darren,

Just a couple of quick points, please understand that I'm busy and
haven't really analyzed your efforts. I've maintained from day one that one
is much better off avoiding calling Java from RPG . My "day one" is from
about 1997 - I'll leave it up to you to decide whether I now have 13 years
of Java experience or one year 13 times. You can check this list for
reasons to avoid JNI. I've never had a situation where it was required.
One benefit, as you've noticed, is large performance gains.

Second, using things when "I'm not really clear on what that means" is
not a good idea. Static means a class variable; i.e. there is only one for
all instances of the class. You don't even need to construct an instance to
use it. Sounds cool, but you've just thrown away any chance of
multi-threading using that variable. If it's a constant, great (probably,)
but if it's really a variable for an instance, or intended to work as a
local variable, you can run across a class of bugs that is very difficult to
resolve.

I'm sure you're having a great learning experience, which is worthwhile
in itself, but you may want to do more research before putting it into
production.

Best,


Joe Sam

Joe Sam Shirah - http://www.conceptgo.com
conceptGO - Consulting/Development/Outsourcing
Java Filter Forum: http://www.ibm.com/developerworks/java/
Just the JDBC FAQs: http://www.jguru.com/faq/JDBC
Going International? http://www.jguru.com/faq/I18N
Que Java400? http://www.jguru.com/faq/Java400

----- Original Message ----- From: <darren@xxxxxxxxx>
To: "Java Programming on and around the iSeries / AS400"
<java400-l@xxxxxxxxxxxx>
Sent: Wednesday, March 31, 2010 11:49 AM
Subject: Re: HSSF POI performance improvement with Java helper routine
bugged


Here is an analysis of my heap dump. I've modified the Java program a
little bit, removing the String object creation, and making it a compound
statement instead, to reduce String object leaks. If the table looks
funny, try changing the text to a monospaced format, like Courier. I
guess
my first question is, did I code the Java correctly. I made it 'static',
and I'm not really clear on what that means when calling from RPG. I see
that quite a few of the HSSF api's are not static, so I'm suspicious that
I
might have setup my methods incorrectly:

public static void Text(HSSFRow row, int col, byte[] array, HSSFCellStyle
style ) {

HSSFCell cell = row.createCell(col);
cell.setCellType(1);
cell.setCellValue(new HSSFRichTextString(new String(array)));
cell.setCellStyle(style);
}


Class Name | Objects |
Shallow Heap
--------------------------------------------------------------------------------------
| |
org.apache.poi.hssf.usermodel.HSSFCell | 724,461 |
28,978,440
org.apache.poi.hssf.record.NumberRecord | 550,463 |
17,614,816
org.apache.poi.hssf.record.LabelSSTRecord | 173,998 |
5,567,936
org.apache.poi.hssf.record.CellValueRecordInterface[] | 28,996 |
5,101,712
org.apache.poi.hssf.usermodel.HSSFCell[] | 28,996 |
5,101,664
org.apache.poi.hssf.usermodel.HSSFRichTextString | 173,998 |
4,175,952
org.apache.poi.hssf.record.RowRecord | 28,996 |
1,391,808
java.lang.Integer | 57,992 |
927,872
org.apache.poi.hssf.usermodel.HSSFRow | 28,996 |
927,872
java.lang.Object[] | 1,851 |
498,640
org.apache.poi.hssf.record.CellValueRecordInterface[][] | 4 |
123,184
java.util.TreeMap$Node | 912 |
51,072
java.util.ArrayList | 26 |
832
org.apache.poi.hssf.record.ColumnInfoRecord | 16 |
640
java.util.HashMap$Entry[] | 8 |
640
java.util.TreeMap | 8 |
384
java.util.HashMap | 8 |
384
org.apache.poi.hssf.model.Sheet | 4 |
384
org.apache.poi.hssf.record.PrintSetupRecord | 4 |
256
org.apache.poi.hssf.record.aggregates.PageSettingsBlock | 4 |
256
org.apache.poi.hssf.record.BOFRecord | 4 |
160
org.apache.poi.hssf.record.WindowTwoRecord | 4 |
160
org.apache.poi.hssf.usermodel.HSSFSheet | 4 |
160
org.apache.poi.hssf.record.aggregates.RowRecordsAggregate | 4 |
160
org.apache.poi.hssf.record.SelectionRecord | 4 |
128
org.apache.poi.hssf.record.HeaderRecord | 4 |
128
org.apache.poi.hssf.record.DimensionsRecord | 4 |
128
org.apache.poi.hssf.record.FooterRecord | 4 |
128
org.apache.poi.hssf.util.CellRangeAddress8Bit | 4 |
128
org.apache.poi.hssf.record.GutsRecord | 4 |
128
char[] | 1 |
120
org.apache.poi.hssf.record.aggregates.ValueRecordsAggregate| 4 |
96
org.apache.poi.hssf.record.DeltaRecord | 4 |
96
org.apache.poi.hssf.record.DefaultRowHeightRecord | 4 |
96
org.apache.poi.hssf.record.WSBoolRecord | 4 |
96
org.apache.poi.hssf.record.HorizontalPageBreakRecord | 4 |
96
org.apache.poi.hssf.record.VerticalPageBreakRecord | 4 |
96
org.apache.poi.hssf.util.CellRangeAddress8Bit[] | 4 |
96
org.apache.poi.hssf.record.CalcCountRecord | 4 |
64
Total: 39 of 60 entries | 1,799,874 |
70,468,176
--------------------------------------------------------------------------------------

--
This is the Java Programming on and around the iSeries / AS400 (JAVA400-L)
mailing list
To post a message email: JAVA400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/java400-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.