Compiler safepoints do not work on SPARC.
Run the appended program with following commandline
and it will hang (use server VM)
java -Xcomp -verbose:gc sf
Run it with following commandline and it terminates properly:
java -Xint -verbose:gc sf
The program hangs if the method loop is compiled because
the runtime cannot properly suspend the endless loop.
I have verified that Compiler 2 (server) is
emitting safepoint information.
----------------
public class sf {
static public boolean _xx = true;
public static void main(String[] args) {
new Srdjan().start();
}
public void start() {
new TesterThread().start();
new GCThread().start();
}
class TesterThread extends Thread {
// trick compiler 2 in believing that this is not and endless loop
public void loop (int n) {
long counter = 0;
while (_xx) {
if (n == 0) {
_xx = false;
}
}
}
public void run () {
System.out.println("Start loop");
loop(3);
}
}
class GCThread extends Thread {
public void run () {
System.out.println("Starting GC loop");
long counter = 0;
while (true) {
try { sleep(250); } catch (InterruptedException ix) {}
System.gc();
counter++;
if (counter == 10) {
_xx = false;
return;
}
}
}
}
}
Run the appended program with following commandline
and it will hang (use server VM)
java -Xcomp -verbose:gc sf
Run it with following commandline and it terminates properly:
java -Xint -verbose:gc sf
The program hangs if the method loop is compiled because
the runtime cannot properly suspend the endless loop.
I have verified that Compiler 2 (server) is
emitting safepoint information.
----------------
public class sf {
static public boolean _xx = true;
public static void main(String[] args) {
new Srdjan().start();
}
public void start() {
new TesterThread().start();
new GCThread().start();
}
class TesterThread extends Thread {
// trick compiler 2 in believing that this is not and endless loop
public void loop (int n) {
long counter = 0;
while (_xx) {
if (n == 0) {
_xx = false;
}
}
}
public void run () {
System.out.println("Start loop");
loop(3);
}
}
class GCThread extends Thread {
public void run () {
System.out.println("Starting GC loop");
long counter = 0;
while (true) {
try { sleep(250); } catch (InterruptedException ix) {}
System.gc();
counter++;
if (counter == 10) {
_xx = false;
return;
}
}
}
}
}
- relates to
-
JDK-6703104 Java hang as per old bugs.sun.com Solaris bug
-
- Closed
-