What is JConsole? The standard JMX Client

Java Conceptuel Diagram

About

JConsole is a JMX client (ie Its' as jmx graphical tool for monitoring a Java virtual machine)

Its full name is Java Monitoring and Management Console.

It:

  • is included with the Java SE platform (version 5 onwards).
  • provides information about the performance and resource consumption of applications that are running on the Java platform.

Example

A snapshot of Jconsole Memory where we can see the garbage collector reducing the heap memory periodically.

Jconsole Memory Tab

Step by Step

Open Jconsole

JConsole resides in the 'bin' (binaries) folder under the JDK Java directory.

To call Jsonsole, the path is:

JDK_HOME/bin/jconsole.exe

where JDK_HOME is the path to the JDK directory

Example:

where java
C:\Program Files\Microsoft\jdk-11.0.12.7-hotspot\bin\java.exe

"C:\Program Files\Microsoft\jdk-11.0.12.7-hotspot\bin\jconsole.exe"

Make a connection

You will be prompted to create a new connection.

JConsole, or any JMX client, will not see applications that are not owned by the same user.

For example under Windows, if an application is started as a service, it is the System User who owns the process, and not the Current User.

Local

You just need to pick the Java process that you want to monitor

Remote

To be able to connect remotely, you need to enable JmxRemote by adding the jmxremote parameters to the execution of your java application.

Example:

java
-Dcom.sun.management.jmxremote \
-Dcom.sun.management.jmxremote.port=9010 \ # port is mandatory as there is no default
-Dcom.sun.management.jmxremote.local.only=false \
-Dcom.sun.management.jmxremote.authenticate=false \
-Dcom.sun.management.jmxremote.ssl=false \
-Djava.rmi.server.hostname=hostname \ # optional default to the os hostname
....

If your application is JmxRemote enabled, you connect by entering:

  • the hostname where your application is running
  • the JMX remote port

Plugin

See:

 JDK_HOME/bin/jconsole -pluginpath JDK_HOME/demo/management/JTop/JTop.jar

Documentation





Discover More
Java Conceptuel Diagram
JMX - Client

A Jmx client is a client that can connect to a Jmx instance of the Jvm. Any JMX client will not see applications that are not owned by the same user. For example under Windows, if an application is...
Jconsole New Connection Jmxhello
JMX - Standard MBean

From Java Management Extensions (JMX) (API, Tutorial) Write the code: The gerardnico/java-demo/blob/master/src/Jmx/HelloMBean.javaBean...
Jconsole Memory Chart
JVM - Memory (The Heap)

The JVM memory consists of the following segments: Heap Memory, which is the storage for Java objects Non-Heap Memory, which is used by Java to store loaded classes and other meta-data JVM code...



Share this page:
Follow us:
Task Runner