tags:

views:

45

answers:

2

We are calling a Java program on a iseries machine and the first call to the program is quiet slow. The following calls are fast but if we wait a certain time the call is slow again.

How can I keep the JVM up and running or is there another way to solve this problem?

Thanks

+1  A: 

The newest JVM's (IBM Technology for Java) are the fastest available. The typical problem is that if the JVM's own jars are cached in memory then it is quite fast to load - if not, they need to be loaded from disk as needed which is quite slow. (There is actually an accelleration process for this under Windows).

You could consider having a small script which simply reads through all the jars for the JVM every X seconds, or to implement a "communicate with daemon JVM through dataqueues" which is the traditional approach for this.

Thorbjørn Ravn Andersen
Thanks for you answer. Could you please give an example of such a script or point me to some documentation on how to do that and how to implement the dataqueues?
Your best bet for now is to have the JVM's run in their own subsystem.
Thorbjørn Ravn Andersen
A: 

You might want to consider making your java application a server that is running all the time ... your native app can send & receive requests to the server using tcp or data queues.

That way the start up cost for the server is a one time thing and none of the users never have to suffer through it.

david