Can JVisualVM “Heap Dump” button release memory?

后端 未结 2 436
小鲜肉
小鲜肉 2021-01-12 15:18

i have a very strange problem. I\'m working on an OSGi application, based on Eclipse Equinox; it was developed using OSGi Log Service (Equinox implementation) and now I\'m t

2条回答
  •  悲哀的现实
    2021-01-12 15:49

    Can "Heap Dump" operation release almost 200 mbs? If yes, WHY?

    Yes it can. I haven't studied the code but I am pretty sure it calls HotSpotDiagnosticMXBean.dumpHeap with the second argument set to true (it is the default if you call it form jconsole or the MBeans extension to JVisualVM). In my experience, doing so will trigger an explicit gc before it dumps the heap and that is probably the answer to the "Why?".

提交回复
热议问题