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

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:+UseParNewGC To be done
-XX:+UseParallelGC JMXParallelGC
-XX:+UseParallelOldGC JMXParallelGC
-XX:+UseG1GC 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
name=ParNew name=MarkSweepCompact To be done
name=PS Scavenge name=PS MarkSweep JMXParallelGC
name=G1 Young Generation name=G1 Old Generation To be done

Java 8 removed Permanent generation, so all previous probes are unusable with it. The only supported probed supported for now with Java 8 are JMXParallelGC8 and JMXConcMarkSweepGC8.

sourcetype/jmx/start.txt · Last modified: 2016/09/01 15:07 by root     Back to top