FULL PRODUCT VERSION :
java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
Java HotSpot(TM) Client VM (build 1.5.0-b64, mixed mode, sharing)
FULL OS VERSION :
Linux 2.4.22-1.2199.nptl #4 Fri Sep 24 15:48:45 BST 2004 i686 athlon i386 GNU/Linux
Windows XP
A DESCRIPTION OF THE PROBLEM :
A simple program (see code) takes far longer to execute in java 1.5.0 with "-server" than with "-client". Running with the option "-XX:+PrintCompilation" indicates a compile failure when running with "-server":
starting
1% X::main @ 14 (39 bytes)
1 COMPILE SKIPPED: local schedule failed (not retryable)
45104
Whether the failure occurs seems to depend on the number of iterations in the loop; for me, for COUNT=14562 and lower, my program outputs, say:
X
starting
1
whereas for COUNT=14563 and higher, I get:
starting
1% X::main @ 14 (39 bytes)
1 COMPILE SKIPPED: local schedule failed (not retryable)
3
THE PROBLEM WAS REPRODUCIBLE WITH -Xint FLAG: No
THE PROBLEM WAS REPRODUCIBLE WITH -server FLAG: Yes
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Executing the given code via:
java -server -XX:+PrintCompilation X
gives:
starting
1% X::main @ 14 (39 bytes)
1 COMPILE SKIPPED: local schedule failed (not retryable)
34933
EXPECTED VERSUS ACTUAL BEHAVIOR :
Executing:
java -client -XX:+PrintCompilation X
gives no problem:
1 b java.lang.String::hashCode (60 bytes)
2 b java.lang.String::charAt (33 bytes)
starting
1% b X::main @ 14 (39 bytes)
2298
Compiling and running in 1.4.2, I get no problem with either "-server" or "-client". ie. for:
java version "1.4.2_02"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_02-b03)
Java HotSpot(TM) Client VM (build 1.4.2_02-b03, mixed mode)
I get:
java -client -XX:+PrintCompilation X
giving:
1 b java.lang.String::charAt (33 bytes)
starting
1% b X::main @ 14 (39 bytes)
2974
and
java -server -XX:+PrintCompilation X
giving:
starting
1% X::main @ 14 (39 bytes)
4
The problem seems dependent not only on the loop count, but on the presence of other elements of the code. For example, if the line printing "starting" is removed, in 1.5.0,
java -server -XX:+PrintCompilation X
gives:
1% X::main @ 6 (31 bytes)
141
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
public class X {
private static int COUNT = 1000000000;
public static void main(String[] args) {
System.out.println("starting");
long start = System.currentTimeMillis();
for (int i = 0; i < COUNT; i++) { }
System.out.println(System.currentTimeMillis() - start);
}
}
---------- END SOURCE ----------
Release Regression From : 1.4.2_06
The above release value was the last known release where this
bug was known to work. Since then there has been a regression.
###@###.### 2004-12-16 21:32:33 GMT