O'Reilly logo

Java 9 Cookbook by Nick Samoylov, Mohamed Sanaulla

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How it works...

To get help for the jcmd utility, run the following command:

jcmd -h 

Here is the result of the command:

It tells us that the commands can also be read from the file specified after -f and that there is a PerfCounter.print command, which prints all the performance counters (statistics) of the process.

 Let's run the following command:

jcmd Chapter12Memory GC.heap_info

The output may look as follows:

It shows the total heap size and how much of it was used, the size of a region in the young generation and how many regions are ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required