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 to do it...

  1. Get the full list of the available jcmd commands by running the following line:
      jcmd PID/main-class-name help

Instead of PID/main-class, put the process identifier or the main class name. The list is specific to the JVM, so the command requests the data from the specific process.

  1. If you can, compile the same class with JDK 8 and with JDK 9 and run the preceding command for each of the JSK versions. This way, you can compare the lists and see that JDK 9 introduced the following new jcmd commands:
    • Compiler.queue: This prints the methods queued for compilation with either C1 or C2 (separate queues)
    • Compiler.codelist: This prints n-methods (compiled) with full signature, address range, and state (alive, non-entrant, and ...

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