jmap - Does histo & heap operation bring overhead to jvm?

巧了我就是萌 提交于 2019-12-05 23:28:59
apangin

jmap -histo and jmap -heap work differently: jmap -histo uses Dynamic Attach Mechanism, and jmap -heap works through HotSpot Serviceability Agent. The difference is described here.

Therefore, jmap -histo is executed by JVM itself, but jmap -heap runs in a tool process while JVM process is suspended. In both cases no new Java objects are created, the tool will not cause OutOfMemoryError.

In both cases application threads are stopped: jmap -histo stops Java threads, and jmap -heap stops the whole JVM process. The duration of the pause can be rather long especially for large heaps. E.g. it may take several seconds to walk through 4GB heap.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!