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



Dieter,

< A Java application ist started via QShell or QP2Term and programm java. What you are describing is looking like some Java, RPG, CLLE mix. What are you trying to accomplish, needing a mix of those three languages? That's far away from all best practices and as you noticed yourself, you will get lots of problems, you won't have with any of those languages by itself.>

Why should you not call Java from an RPGLE or CLLE pgm?

< But anyway best practice in Java is not to mix up Java with JNI for applications. JNI is designed for the implementation of the JVM and the Java Tools (java, javac, jar ...) not for writing applications.>

Again, why best practice?

Programmer added code to free up local Java objects.
Big improvement, but still loses performance over time.

"The job ran approx. 1 million API calls in 20 hours. I put in new code to free up local Java objects so the garbage collector makes note of them. The heap size was cut in half and it processed faster. The original one I ran on Tuesday - Wednesday took 6 hours 15 minutes to perform the first 400000. This one performed the 400000 in 3 hours 7 minutes.

However, it still appears to lose processing speed over time. At the start the job will perform 60 API calls per second. At the end, it only does about 6 API calls per second."

Paul



-----Original Message-----
From: JAVA400-L [mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of D*B
Sent: Saturday, June 20, 2015 5:17 AM
To: java400-l@xxxxxxxxxxxx
Subject: Re: Java batch job performance issue

<Paul>
We are testing our first Java application</Paul> <Paul> The process is called from an RPGLE pgm, Java is initialized in CLLE pgm.
</Paul>

A Java application ist started via QShell or QP2Term and programm java. What you are describing is looking like some Java, RPG, CLLE mix. What are you trying to accomplish, needing a mix of those three languages? That's far away from all best practices and as you noticed yourself, you will get lots of problems, you won't have with any of those languages by itself.

Java on AS/400 (and all compatible systems) is optimized for server java, in other words: the startup of a JVM is rather slow (compared to Wintel and Co.), if it is once up and running speed is ok for older JVMs and good for
J9 JVM. Compared to native workload each JVM needs much more ressources than
5250 or RPG/CL Batch and the JNI support of the RPG compiler is rather buggy. But anyway best practice in Java is not to mix up Java with JNI for applications. JNI is designed for the implementation of the JVM and the Java Tools (java, javac, jar ...) not for writing applications.

If you are really needing RPG/Java interaction, an asynchronous approach (RPG talking to a Java Server Job via DataQ or socket connect) would be by far easier and better. Feel free to use my OpenSource appserver4rpg, it's the base layer for ArdGate and CommandGate and extendable.

D*B


--
This is the Java Programming on and around the IBM i (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.