The jcmd command is a great command-line tool but is a bit raw. However, the JVM provides additional tooling to yield metrics linked to performance and, in particular, the CPU and memory. JVisualVM and JConsole are two such tools packaged with the JDK (not the JRE). Since both are pretty similar, we will only deal with JVisualVM in this section, but most of the information and tools can be used with JConsole as well.
To launch JVisualVM, you just have to execute a command of the same name:
Once launched, you will see the welcome screen of jvisualvm:
To start using jvisualvm