I'm monitoring a WildFly 10.1.0.Final Java process via SNMP port (configuring the com.sun.management.snmp properties) in a Linux box.
The problem is the reported max values for Eden and Survivor Spaces are zero.
.1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1.11.4 = Counter64: 775946240
.1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1.10.4 = Counter64: 3946840064
.1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1.12.4 = Counter64: 3774873600
.1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1.13.4 = Counter64: 0
.1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1.11.5 = Counter64: 4194304
.1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1.10.5 = Counter64: 0
.1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1.12.5 = Counter64: 4194304
.1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1.13.5 = Counter64: 0
.1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1.2.2 = STRING: "Metaspace"
.1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1.2.3 = STRING: "Compressed Class Space"
.1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1.2.4 = STRING: "G1 Eden Space"
.1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1.2.5 = STRING: "G1 Survivor Space"
.1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1.2.6 = STRING: "G1 Old Gen"
The same monitoring script is used in a lot of other Java processes, which do not report this issue.
What can cause that? Cann these values be zero?
Best regards
The problem here is that
jvmMemPoolMaxSize(OID.1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1.13) is defined in JVM-MANAGEMENT-MIB as typeJvmUnsigned64TC, which seems kind of strange because Java specifically forbids the use of unsigned integer types.The description for
jvmMemPoolMaxSizeimplies that it's meant to represent the value returned byjava.lang.management.MemoryPoolMXBean.getUsage().getMax(). The documentation for that method says "This method returns -1 if the maximum memory size is undefined."The description of
jvmMgmMIBaddresses the issue with this explanation:I think it's safe to say this is one of the cases where a zero is not valid, so you should take it to mean that there is no defined maximum.