Increasing response time for createJvm()

General discussion on the JZOS batch launcher and toolkit
Post Reply
orr94
Posts: 22
Joined: Thu Feb 24, 2005 1:28 pm

Increasing response time for createJvm()

Post by orr94 »

Having spent far too much time using BPXBATCH and JRIO for my z/OS Java applications, I'm very pleased with the features JZOS offers me. However, to my surprise, the startup time for JZOS is a good deal slower than BPXBATCH on my system. Is this normal, or is there some way I can tune my environment to make JZOS start up faster?

Using the HelloWorld sample included with JZOS, I found that BPXBATCH was running it in about 6 seconds on average, whereas JZOS was taking about 20 seconds. This is not a problem for batch applications, but I would also like to use JZOS in real-time applications; in that case, a 15 second increase in response time is significant.

I turned on the tracing for JZOS, and I found that most of the time is spent inside the createJvm() function. Here is the relevant section of the trace output:

Code: Select all

01:32:51 JZOSVM13(T): -> initializeVMArgs()                                     
01:32:51 JZOSVM13(T): vm_args.version: 10002                                   
01:32:53 JZOSVM13(T): Allocating JVM options                                   
01:32:53 JZOSVM13(T): Setting exit hook option                                 
01:32:53 JZOSVM13(T): Setting abort hook option                                 
01:32:53 JZOSVM13(T): Getting CLASSPATH                                         
01:32:53 JZOSVM13(T): Setting classpath option                                 
01:32:53 JZOSVM13(T): <- initializeVMArgs()                                     
01:32:53 JZOSVM13(T): -> createJvm()                                           
01:32:59 JZOSVM13(N): Java Virtual Machine created.  Version information follows:
01:32:59 JZOSVM13(T): -> invoke()                                               
01:33:06 JZOSVM13(D): About to invoke com.dovetail.jzos.ZUtil.getJavaVersionInfo()
01:33:06 JZOSVM13(T): <- invoke()                                               
java version "1.3.1"                                                           
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1)                 
Classic VM (build 1.3.1, J2RE 1.3.1 IBM OS/390 Persistent Reusable VM build cm131s-20031114 (JIT enabled: jitc))
01:33:06 JZOSVM13(T): <- createJvm()
Are there any thoughts about how I could improve the startup time for JZOS? I am using JZOS 1.1.1 and Java 1.3.1 on a z/OS 1.4 system.
dovetail
Site Admin
Posts: 2025
Joined: Thu Jul 29, 2004 12:12 pm

Post by dovetail »

This is -not- normal. We have had one other report of this, but it was with JDK 1.4. IBM's Washington Systems Center was not able to reproduce the problem, nor were we, and they guessed that there was something wrong with the customer's LE environment and suggested that a problem be opened with the IBM support center. (I'm not sure if this has been done...)

So, I apologize asking you to do this, but could you please open a problem with IBM? The subject should be something like: "Java JNI_CreateJavaVM() performance problem". I would suggest that you rerun the job with LE report options turned on, something like this:

//JAVA EXEC PROC=EXJZOSVM,VERSION='13',
// LOGLVL='+T',
// LEPARM='RPTOPTS(ON),RPTSTG(ON)',
// JAVACLS='HelloWorld'

And provide the job output to IBM. If you have difficulties with the support center, please send me an email at dev@jzos.com, and we will try to assist.

If someone can find out what environmentally is causing this, then we will write something up for the web site to alert others to the problem.
coz
Posts: 392
Joined: Fri Jul 30, 2004 5:29 pm

Post by coz »

Could you specify the JVM switch "-Xquickstart" in your JCL and re-run your tests? I'd like to see if you get different numbers around the jvm creation and version information call.
orr94
Posts: 22
Joined: Thu Feb 24, 2005 1:28 pm

Post by orr94 »

Sorry I've taken so long to reply... I've been out of the office.

At any rate, the -Xquickstart switch worked wonders! The section that was taking about 15 seconds is down to 2-3 seconds. Perfect!

So what exactly does that switch do, anyway? I have to assume I'm sacrificing something, otherwise it would be a default...

Thanks for your help!
coz
Posts: 392
Joined: Fri Jul 30, 2004 5:29 pm

Post by coz »

It's a switch that modifies the behavior of the just in time (JIT) compiler. From the java diagnostic guide:

-Xquickstart Used for improving startup time of some Java applications. -Xquickstart causes the JIT to run with a subset of optimizations; that is, a quick compile. This quick compile allows for improved startup time. -Xquickstart is appropriate for shorter running applications, especially those where execution time is not concentrated into a small number of methods. -Xquickstart can degrade performance if it is used on longer-running applications that contain hot methods. The implementation of -Xquickstart is subject to change in future releases.

As we mentioned earlier, your configuration is atypical - most of our users see much faster startup times without this switch. Knowing that you get a significant performance benefit may help us figure out what's happening in the slow startup cases.

Thanks for testing this - you should be able to run with the switch enabled; just keep the above guidelines in mind if you change the way you use java in batch (i.e. create longer running jobs with lots of duplicate method calls).
Post Reply