不幸的是,看起来这个最近封闭的问题还不太清楚.这是典型的输出:
run:
Trying to Remove JDialog
Remove Cycle Done :-)
Checking if still exists any of TopLayoutContainers
JFrame
JDialog
Will Try Remove Dialog again, CycleNo. 1
-----------------------------------------------------------
Trying to Remove JDialog
Remove Cycle Done :-)
Checking if still exists any of TopLayoutContainers
JFrame
JDialog
Will Try Remove Dialog again, CycleNo. 2
-----------------------------------------------------------
Trying to Remove JDialog
Remove Cycle Done :-)
Checking if still exists any of TopLayoutContainers
JFrame
JDialog
Will Try Remove Dialog again, CycleNo. 3
-----------------------------------------------------------
Trying …Run Code Online (Sandbox Code Playgroud) 我的空无限循环
public static void main(String[] args) {
while (true) {}
}
Run Code Online (Sandbox Code Playgroud)
和Java VisualVM中的分析(图片)

如您所见,我不创建对象.为什么换堆?
请解释一下效果.为什么?