Debugging 为什么intellij idea不立即终止调试过程?

Debugging 为什么intellij idea不立即终止调试过程?,debugging,intellij-idea,Debugging,Intellij Idea,我使用的是idea 2016.1.1,我想知道为什么单击“停止”按钮时idea不会立即终止调试过程 例如,使用这段代码复制它 public class Main { public static void main(String[] args) { int i = 0; while (true) { i++; System.out.print("I'm still alive: "); System.out.println(i);

我使用的是idea 2016.1.1,我想知道为什么单击“停止”按钮时idea不会立即终止调试过程

例如,使用这段代码复制它

public class Main {

  public static void main(String[] args) {
    int i = 0;
    while (true) {
      i++;
      System.out.print("I'm still alive: ");
      System.out.println(i);
    }
  }
}
在循环开始之前设置断点

启动调试会话,等待它中断,然后按红色的停止按钮(CTRL-F2)

我希望进程立即停止,它不会打印任何内容,但会打印:

"C:\Program Files\Java\jdk1.6.0_38\bin\java" ....
Connected to the target VM, address: '127.0.0.1:54394', transport: 'socket'
Disconnected from the target VM, address: '127.0.0.1:54394', transport: 'socket'
I'm still alive: 1
I'm still alive: 2
I'm still alive: 3
I'm still alive: 4
...
I'm still alive: 319
I'm still alive: 320
I'm still alive: 321
I'm still alive: 
Process finished with exit code -1
为什么进程没有立即停止?

是否有其他方法强制立即停止?

编辑


刚刚用创意14.1.5尝试了一下。该过程如预期的那样立即停止。似乎2016年引入了一个bug。

到目前为止我的调查

当IDEA启动java进程时,它使用主包装器。此包装启动一个守护进程线程,该线程侦听
ServerSocket
中的命令

IDEA向该服务器套接字发送一个
STOP
信号。当服务器线程收到
STOP
信号时,它使用
System.exit(1)
存在jvm

IDEA似乎从调试中恢复JVM,然后发送
STOP
信号。因此,在收到
停止
信号之前,该过程将继续


我在

打开了一个bug,该bug在2016.3(163.7743.44)
中修复。我刚刚验证过。

在调试会话中按
停止时,
IntelliJ Idea的默认行为是不立即终止进程

但是如果您需要更改此行为以立即终止调试过程
我认为这应该是默认行为:)

您可以通过设置激活它:
设置
生成、执行、开发
调试器
>


如果ppl希望看到这个bug很快得到修复,他们应该就youtrack问题进行投票。最新版本仍然适用于我。编辑:无所谓,这里提到了一个设置: