JMX

The Java Management Extensions (JMX) is used for managing and monitoring applications and services. The API make it possible to add manageability to Java apps. It provides Java developers with the means to instrument the code so that developers get get insights about their applications performance.

JConsole

The JConsole is a JMX compliant tool that connects to a running JVM, which started with the management agent. It provides several monitoring and management functionalities, including memory, cpu, threads and many more.

Example

This example demonstrate how to enable JMX agent in a Quarkus app and also how to use JConsole to explore the app's health.

mvn compile quarkus:dev -Dcom.sun.management.jmxremote \
-Dcom.sun.management.jmxremote.local.only=false -Djava.rmi.server.hostname=localhost

Starting JConsole

JConsole is a tool distributed with JDK and it can be launched via terminal typing jconsole.

Selecting app's ID and clicking connect...

jconsole

Will open up the monitoring and management console, with all information related to Memory, CPUs, Threads and etc.

jconsole