How do you Force Garbage Collection from the Shell?

前端 未结 9 681
滥情空心
滥情空心 2020-11-30 17:42

So I am looking at a heap with jmap on a remote box and I want to force garbage collection on it. How do you do this without popping into jvisualvm or jconsole and friends?<

9条回答
  •  攒了一身酷
    2020-11-30 17:57

    If you run jmap -histo:live , that will force a full GC on the heap before it prints anything out.

提交回复
热议问题