How to check heap usage of a running JVM from the command line?

前端 未结 4 1300
忘了有多久
忘了有多久 2020-12-12 21:34

Can I check heap usage of a running JVM from the commandline, I mean the actual usage rather than the max amount allocated with Xmx.

I need it to be commandline beca

4条回答
  •  鱼传尺愫
    2020-12-12 21:42

    If you start execution with gc logging turned on you get the info on file. Otherwise 'jmap -heap ' will give you what you want. See the jmap doc page for more.

    Please note that jmap should not be used in a production environment unless absolutely needed as the tool halts the application to be able to determine actual heap usage. Usually this is not desired in a production environment.

提交回复
热议问题