一个可以把windows系统跑死的Java程序
public class JavaVMStackOOM {
private void dontStop(){
while (true){}
}
public void stackLeakByThread(){
while (true){
Thread thread = new Thread(){
@Override
public void run() {
dontStop();
}
};
thread.start();
}
}
public static void main(String []args){
JavaVMStackOOM oom = new JavaVMStackOOM();
oom.stackLeakByThread();
}
}
疯狂创建线程