I have explained this exact situation here:Frédéric GRANAT wrote: When Check_tomcat.pl reports by example 1 Gb of memory used, the taskmanager reports, by the same time, 2,2 Gb for Tomcat process memory usage.
Effectively, the history of memory consumption is logged by NagiosXI, but the memory consumption doesn't match the values showed by the taskmanager for Tomcat process
The JVM might want to "reserve" memory for a variety of reasons.mcapra wrote:One is reporting on the Windows environment (task manager), the other is reporting on the JVM (check_tomcat.pl).
The JVM can hold as much memory for its heap as the OS allows, or up to the -Xmx setting for its runtime. That doesn't necessarily mean the JVM's processes are using all of that heap in any given instant, though.
In the above scenario, the JVM has requested 2,2GB from the OS (Windows) for its heap. Of that 2,2GB in the heap, the Tomcat process inside that JVM is currently using 1GB. Why is the JVM reserving an additional 1,2GB for its heap? I cannot say, but isn't not exactly uncommon practice especially with Tomcat. I'd wager someone told Tomcat's JVM to do that by modifying the -Xms value at run-time.
If you don't care about JVM technicals and specifics, you could use a different plugin and monitor the Tomcat process as it exists on the OS level, rather than as it exists inside a JVM. There's pros and cons to both approaches. Both NSClient++ and check_wmi_plus should have the necessary tools to get memory usage of a given process. NCPA should have it with the release of 3.0.0.