Back to Geneos FAQ

How to monitor the JVM heap size

The JMX Plugin can be configured to connect to the monitored JVM application, look up specific Mbeans and retrieve values of their attributes (such as heap size).

Below is a sample JMX template that captures the heap memory usage. In the JMX sampler, the serviceUrlRmi variable should point to the serviceURL which contains the hostname/IP, port and JMX details. The format would look like service:jmx:rmi:///jndi/rmi://:/jmxrmi.

<sampler name="JMX HeapMemory Demo">  <plugin>  <jmx-server>  <connection>  <generic>  <serviceURL>  <var ref="serviceUrlRmi"/>  </serviceURL>  </generic>  </connection>  <aliases>  <alias>  <name>$1</name>  <value>  <data>java.lang:type=Memory,*</data>  </value>  </alias>  </aliases>  <columns>  <column>  <label>Name</label>  <rowTemplate>  <data>HeapMemory</data>  </rowTemplate>  </column>  <column>  <label>Init</label>  <rowTemplate>  <data>$1.HeapMemoryUsage.init</data>  </rowTemplate>  </column>  <column>  <label>Max</label>  <rowTemplate>  <data>$1.HeapMemoryUsage.max</data>  </rowTemplate>  </column>  <column>  <label>Used</label>  <rowTemplate>  <data>$1.HeapMemoryUsage.used</data>  </rowTemplate>  </column>  <column>  <label>Committed</label>  <rowTemplate>  <data>$1.HeapMemoryUsage.committed</data>  </rowTemplate>  </column>  </columns>  <idAttributes/>  </jmx-server>  </plugin> </sampler>

Below is the dataview of the XML configuration above: Screenshot

Please see the JMX Plugin documentation for more details.

["Geneos"] ["Geneos > Netprobe"] ["FAQ"]

Was this topic helpful?