From http://forums.sun.com/thread.jspa?threadID=5414815:
While testing JVM 1.6.16 before using it for our application i've found a strange bug.
The VM ALWAYS crash when i execute this quite simple sample of code.
Do anyone reproduce the problem or has any clue of it's reason ?
package crashVM;
public class CrashTest {
/**
* @param args
*/
public static void main(String[] args) {
for (int i = 0; i < 2; i++)
NestedLoop();
}
public static long NestedLoop() {
final int n = 50;
long startTime = System.currentTimeMillis();
int x = 0;
for (int a = 0; a < n; a++)
for (int b = 0; b < n; b++)
for (int c = 0; c < n; c++)
for (int d = 0; d < n; d++)
for (int e = 0; e < n; e++)
for (int f = 0; f < n; f++)
x++;
long stopTime = System.currentTimeMillis();
return stopTime - startTime;
}
}
Thanx !