Why does JVM heap keep growing?

前端 未结 3 453
-上瘾入骨i
-上瘾入骨i 2021-02-08 18:52

I write a simple program and use jconsole.exe to monitor its heap size.

public class HeapTest {
    public static void main(String[] args) {
        while(true)          


        
3条回答
  •  一生所求
    2021-02-08 19:20

    you've assumed that main( ) is your only thread, which is an incorrect assumption. There are other threads that will allocate objects

提交回复
热议问题