To get help for the jcmd utility, run the following command:
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 ...