jconsole - Connecting to a Remote JMX Agent

This section provides a tutorial example on how to run 'jconsole' to connect to a JMX agent running on a remote machine, and how to see memory usage detail information.

If you follow the tutorial presented in the previous section, the PrimeNumberSeeker.java is running in a JVM with the remote JMX agent turned on waiting for remote connections at the port: 6789.

Now we can run "jconsole localhost:6789" to connect to this JVM remotely to monitor how my PrimeNumberSeeker.java is running:

1. Run "jconsole localhost:6789". "jconsole" connects to my Java application correctly. Surprisingly, I am still getting the "Secure connection failed. Retry insecurely?" warning. Looks like JConsole in Java 8 has a bug.

2. Click the "Insecure connection" button to continue the connection. The Java Monitoring & Management Console shows up.

3. Click the Memory tab, the memory usage detail information show up as shown in this picture:

jconsole Memory Usage Tab
jconsole Memory Usage Tab

Table of Contents

 About This Book

 Java Tools Terminology

 Java Tools Included in JDK

 javac - The Java Program Compiler

 java - The Java Program Launcher

 jar - The JAR File Tool

 jlink - The JRE Linker

 jmod - The JMOD File Tool

 jimage - The JIMAGE File Tool

 jpackage - Binary Package Builder

 javadoc - The Java Document Generator

 jdeps - The Java Class Dependency Analyzer

 jdeprscan - The Java Deprecated API Scanner

 jdb - The Java Debugger

 jcmd - The JVM Diagnostic Tool

jconsole - Java Monitoring and Management Console

 JMX Technology and jconsole Tool

 jconsole - Command Options and Connection Window

 com.sun.management.jmxremote - JMX Agent for Local Connection

 jconsole - Connecting to a Local JMX Agent

 com.sun.management.jmxremote.port - JMX Agent for Remote Connection

jconsole - Connecting to a Remote JMX Agent

 jstat - JVM Statistics Monitoring Tool

 JVM Troubleshooting Tools

 jhsdb - The Java HotSpot Debugger

 jvisualvm (Java VisualVM) - JVM Visual Tool

 jmc - Java Mission Control

 javap - The Java Class File Disassembler

 keytool - Public Key Certificate Tool

 jarsigner - JAR File Signer

 jshell - Java Language Shell

 jrunscript - Script Code Shell

 Miscellaneous Tools

 native2ascii - Native-to-ASCII Encoding Converter

 JAB (Java Access Bridge) for Windows

 Archived Tutorials


 Full Version in PDF/EPUB