How to check heap usage of a running JVM from the command line?
问题 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 because I don't have access to a windowing environment, and I want script based on the value , the application is running in Jetty Application server 回答1: You can use jstat, like : jstat -gc pid Full docs here : http://docs.oracle.com/javase/7/docs/technotes/tools/share/jstat.html 回答2: For Java 8 you can use the following command line