Operating System - OpenVMS
Showing results for 
Search instead for 
Did you mean: 

JAVA 1.5-2 consumes a lot of CPU duiring wait

Frequent Advisor

JAVA 1.5-2 consumes a lot of CPU duiring wait

Detached java processes running on I64 VMS 8.3 and java 1.5-2 are consuming CPU minutes when it shouldn't.

This program behaves normal under java 1.4-2 but under java 1.5 it is using CPU the whole day when it shouldn't.
Should I start up these applications with different java flags ?

public class Waiter

public static void main( String[] args )
synchronized ( Waiter.class )
System.out.println( "Before waiting" );
catch ( InterruptedException e )
Situation after two days:

OpenVMS V8.3 on node TESTI64 20-MAY-2008 23:27:14.28 Uptime 30 15:04:07
HP BL860c (1.59GHz/9.0MB)
Pid Process Name State Pri I/O CPU Page flts Pages
0001104D WAITER_142 HIB 5 592 0 00:00:03.24 2534 2575 M
0001144D HIB 6
[453,30] 20600Kb

0000FC4E WAITER_150 HIB 5 652 0 00:06:57.06 3669 3161 M
0001004E HIB 6
[453,30] 25288Kb
Honored Contributor

Re: JAVA 1.5-2 consumes a lot of CPU duiring wait


If I understand correctly, your V1.4-2 process has used 00:03.24 seconds CPU, while the V1.5 process has used 06:57.06 over the same elapsed time?

Are both processes consuming some CPU over time, but at different rates? Do you have a SHOW SYSTEM display from 18th May to compare? Is it a steady consumption, or does it happen in jumps? (collect samples over time and graph them)

The HIB state implies that the wait() operation uses $HIBER/$WAKE. Since $HIBER in itself consumes ZERO CPU, any consumption by the process must be from AST interrupts.

One possible source is from external processes "watching". So, for example, one possible cause might be a SHOW PROCESS/CONTINUOUS running against the V1.5 process, but not against the V1.4-2 process. Some of the data gathered by SHOW PROCESS is collected by executing code in the context of the target process, thereby clocking up some CPU.

Another potential source are the language overheads, like Java garbage collection. Perhaps the default algorithm or timing has changed for V1.5? Maybe it's a bit more aggressive or more frequent? Have you tried different garbage collection settings?

You may be able to get more information using PC profiling to see where the process is spending time. Unfortunately, since you're inside Java, it might take some detective work to interpret what the PC samples mean.
A crucible of informative mistakes