JMX probes

Those probes connects to any JVM with JMX actived to collect info. It can then collect any values accessible in MBeans than can be reach using a simple path declaration. The path loosely follow the idea given in RESTful Access to JMX Instrumentation

JMXConcMarkSweepGC, JMXParallelGC and JMXSerialGC all collects JVM memory info, see individual documentation to see which one to choose.

An easy (but not very secure) way to activate JMX access on a JVM is to add the following arguments :

A lot of usefull informations about JMX can be found at Jean-Francois Denise's blog

The home page for JMX at Oracle is JMX is part of JDKM (Java Dynamic Management Kit). The home page of OpenDMK is A complete document for the latest version of JDMK is

The connection

JMX probes are connected probes

The connection class for this probe is jrds.probe.JMXConnection.


Name Default value Description
port The jxm connection port
protocol rmi The protocol used for the jmx connection
user A user for connection authentication
password A password for connection authentication
url The exact URL of the connexion, usually something like service:jmx:rmi:/jndi/rmi:localhost:10001/rmi

JMX Protocols

JMX can use different protocol to carry requests. The default one is RMI, but it can be really difficult to use it through firewall and NAT. The simpler jmxmp can be used instead. There is not a lot informations about it, but it's described on this blog. To use it, one needs to put jmxremote_optional.jar it the class path. This jar is include in the JMX Remote API Reference Implementation, that can be downloaded at (or what ever place Oracle choose to move it). An alternate solution it to use opendmk_jmxremote_optional_jar.

To make this protocol always available on Linux hosts using alternatives, this jar can be put in /etc/alternatives/jre/lib/ext. For jrds using tomcat6, the jar should be installed in /usr/share/java/tomcat6/.


Both RMI are brittle, heavy and complicated protocols. Using Jolokia is recommended. It needs a little setup on remote side, that is explained at Jolokia's Agents. The parameter serializeException should be set to true.

If deployed using war, it's as simple as adding the following file in /etc/tomcat/Catalina/localhost/jolokia.xml

<Context cookies="false"
	<Parameter name="serializeException" value="true"/>

And a host configuration to use it will be:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE host PUBLIC "-//jrds//DTD Host//EN" "urn:jrds:host">
<host name="tomcatserver" dnsName="tomcatserver">
    <!-- Tomcat -->
    <connection type="jrds.probe.JMXConnection" name="tomcat">
        <attr name="port">8443</attr>
        <attr name="protocol">jolokia</attr>
        <attr name="ssl">true</attr>
    <probe type="JMXParallelGC8" label="tomcat" connection="tomcat"/>
    <probe type="JMXThread" label="tomcat" connection="tomcat"/>
    <probe type="TomcatGRP" label="tomcat" connection="tomcat">
        <attr name="index">ajp-bio-8009</attr>

Garbage Collector choice

A Sun JVM can used different code of GC algorithm. In Java 7, the following arguments is used to choose the GC and it gives the probe to used.

Parameter Probe name
-XX:+UseSerialGC JMXSerialGC
-XX:+UseConcMarkSweepGC JMXConcMarkSweepGC
-XX:+UseConcMarkSweepGC JMXConcMarkSweepGC8 On JVM 8
-XX:+UseParNewGC To be done
-XX:+UseParallelGC JMXParallelGC
-XX:+UseParallelGC JMXParallelGC9 On JVM 9+
-XX:+UseParallelOldGC JMXParallelGC
-XX:+UseG1GC To be done On JVM 7
-XX:+UseG1GC G1GC8 On JVM 8
-XX:+UseG1GC G1GC9 On JVM 9+
-XX:+UseShenandoahGC To be done

If not GC is given, the GC used and the probe to used is given by looking in java.lang:type=GarbageCollector

name=Copy name=MarkSweepCompact JMXSerialGC
name=ParNew name=ConcurrentMarkSweep JMXConcMarkSweepGC On JVM 7-
name=ParNew name=ConcurrentMarkSweep JMXConcMarkSweepGC8 Only for Java 8, ConcMarkSweepGC was deprecated in 9
name=ParNew name=MarkSweepCompact To be done ParNewGC was deprecated in 8, failed in 9, removed in 10
name=PS Scavenge name=PS MarkSweep JMXParallelGC Can also be ParallelOldGC
name=PS Scavenge name=PS MarkSweep JMXParallelGC9 On JVM 9+
name=G1 Young Generation name=G1 Old Generation G1GC8 Only for Java 8
name=G1 Young Generation name=G1 Old Generation G1GC9 Only for Java 9 and 10
name=Shenandoah Major name=Shenandoah Minor To be done Available on RHEL as a Technology Preview

Java 8 removed Permanent generation, so all previous probes are unusable with it.

Java 9 removed the code cache memory pool and splitted it at two code heap: profiled and non profiled nmethods.

sourcetype/jmx/start.txt · Last modified: 2018/11/08 00:05 by root     Back to top