How it works...

In this recipe, we implemented a very simple example: running 10 threads for 100 seconds. These are threads that write messages in the console.

When you execute JConsole, you will see a window that shows all the Java applications that are running in your system. You can choose the one you want to monitor. The window will be similar to the following one:

In this case, we select our sample app and click on the Connect button. Then, you will be asked to establish an insecure connection with the application, with a dialog similar to the following one:

Click on the Insecure connection button. JConsole will show you information ...

Get Java 9 Concurrency Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.