Name: laC46010 Date: 07/30/98
VM -oss flag does not work with jit enabled. The following
test overflows the stack by recursive method invocation. With
jit enabled the depth of recursion does not depend on
-oss stack size option. While this option works fine on 1.2beta3
or 1.2fcs with jit disabled.
Test example and VM diagnostics follow:
-------------------------------------------------------
novo35% cat test.java
public class test {
public static int r = 0;
public static void m(){
r++;
m();
}
public static void main(String argv[]) {
try {
m();
} catch ( StackOverflowError e) {
System.out.println("Recursion depth: " + r);
}
}
}
novo35% uname -a
SunOS novo35 5.5.1 Generic_103640-12 sun4m sparc SUNW,SPARCstation-20
novo35% javac test.java
novo35% java -version
java version "1.2fcs"
Classic VM (build JDK-1.2fcs-C, green threads, sunwjit)
novo35% java -verify -oss1m -ss1m test
Recursion depth: 69842
novo35% java -verify -oss32m -ss32m test
Recursion depth: 69842
novo35% java -verify -oss1m -ss1m -Djava.compiler=none test
Warning: JIT compiler "none" not found. Will use interpreter.
Recursion depth: 25934
novo35% java -verify -oss32m -ss32m -Djava.compiler=none test
Warning: JIT compiler "none" not found. Will use interpreter.
Recursion depth: 830408
# beta version is Ok
novo35% java1.2b3 -version
java version "1.2beta3"
novo35% java1.2b3 -verify -oss1m -ss1m test1
Recursion depth: 25936
novo35% java1.2b3 -verify -oss32m -ss32m test1
Recursion depth: 830410
novo35%
-------------------------------------------------------
======================================================================