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



Larry,

You could google on JNI and get some information and tutorials about using
JNI to start up a JVM.  That should describe the parameters you can modify
to give it more memory and such.

Have you been using the push/pop frame JNI calls?  Rather than release the
memory for each object as you go along you can just pop a frame to release
all the objects created since the last frame push.

Have you considered inverting your process?  Have the main Java program call
some RPG code instead of the other way around?

Have you considered making your RPG to Java call more course grained?  Have
the RPG program pass a file name which is read by Java for the XML.  Or it
could pass a byte array with the XML after it's already read the file.  Have
the Java code return the SQL statement in a byte array provided by the RPG
program.  One call instead of the ten calls you have.  Make the Java method
you're calling static so you don't have to create any objects to call the
Java code.

If you can avoid creating Java objects through JNI then you don't risk
memory leaks.  Have the RPG program pass in all the data structures needed
by the Java code (for both input and output byte arrays).  The Java code can
create and use all the objects it wants but don't let the RPG program see
them.

Paul

-- 
Paul Morgan
Senior Programmer Analyst - Retail
J. Jill Group
100 Birch Pond Drive, PO Box 2009
Tilton, NH 03276-2009
Phone: (603) 266-2117
Fax:   (603) 266-2333

Larry wrote

I have written a RPG service program that transforms XML [using transform
stylesheets (XSLT)] into SQL insert statements. These are then executed over
the database on the iSeries.

To do this I utilise the Java Native Interface (JNI) to create and use java
objects. Basically, I create a transformer object. I then pass the object an
XML stream source to transform, and a stream result to hold the transformed
data.




As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.