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:
A snapshot of Jconsole Memory where we can see the garbage collector reducing the heap memory periodically.
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"
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.
You just need to pick the Java process that you want to monitor
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:
See:
JDK_HOME/bin/jconsole -pluginpath JDK_HOME/demo/management/JTop/JTop.jar