Search code examples
javajava-8snmpoid

Some JVM monitoring checks via SNMP return zero values in JVM 1.8


My monitoring tools uses SNMP to get several internal values of Java Virtual Machines 1.6 and 1.7. The problem is that some values in JVM 1.8 machines return a zero value.

These are NoHeapMemPoolMaxSize (OID: .3.163.1.1.2.23.0) and PoolMaxSize (OID: .3.163.1.1.2.110.1.13.2). The snmpwalk output:

SNMPv2-SMI::enterprises.42.2.900.3.163.1.1.2.23.0 = Counter64: 0
SNMPv2-SMI::enterprises.42.2.900.3.163.1.1.2.110.1.13.2 = Counter64: 0

Have changed the OIDs of these both values? I compared JVM-MANAGEMENT-MIB.mib for Java 6 and Java 8 and I have found no difference.

What is wrong here?


Solution

  • The problem was the JVM had not defined the maximum MetaSpace size. After adding -XX:MaxMetaspaceSize=256m as a command line argument, the snmpwalk command shows that those values are no longer zero:

    SNMPv2-SMI::enterprises.42.2.900.3.163.1.1.2.23.0 = Counter64: 1593835520
    SNMPv2-SMI::enterprises.42.2.900.3.163.1.1.2.110.1.13.2 = Counter64: 268435456
    

    Best regards.