|
On Wed, 14 Jan 2004 cb_ng@xxxxxxx wrote: > I have an RPG program that is calling a java program that runs fine when > run once. Now, this RPG program is being called from a CL program that > has basically an infinite loop with a couple seconds delay between > iterations. The first headache this caused was the job would slow down > over a couples hours time. It was as if some resources were not being > released. I have corrected this by adding a call that destroys the JVM > each iteration. The JVM cannot be restarted in V5R2 and later once it's destroyed, so I wouldn't use this method if I were you. There's obviously a bug in your program that's causing it to not release resources. I suggest fixing that bug rather than ending the JVM. > If anyone has comments or experience with that I would appreciate them. > Now, my problem and reason for the post is that after 6 - 8 hours of > iterations I get a SocketException: too many open files from my java > program. My program opens/closes 2 sockets per iteration. I have > created a java wrapper program that does what the CL/RPG is doing with > hardcoded parameters and after 24+ hours I have yet to see this error. > BTW, I used RUNJVAPGM to run the java on the 400. To me it would appear > to be something in the interaction of RPG with Java! There are some special considerations when calling Java w/RPG and vice-versa. Basically, the standard Java cleanup routines do not work with objects created in a call from an RPG program. Make sure that you're specifically cleaning up any Java objects created in your RPG. > . Increasing the descriptors(ulimit) for the job just delays the error > from occuring. That's what happens when you have resources that aren't freed up. > I have a workaround in place that submits limited iterations as jobs... > but I would like to find an answer as to what/why this is happening. Well, if you REALLY want to make sure things are cleaned up on each iteration, you could do a PWRDWNSYS RESTART(*YES)... :) (I'm kidding -- don't really do that!)
As an Amazon Associate we earn from qualifying purchases.
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.