Page 1 of 3
check tomcat memory
Posted: Wed Feb 07, 2018 5:46 am
by Frédéric GRANAT
Hi,
I want to check tomcat process memory usage.
I'm using $USER1$/check_tomcat.pl -H $HOSTADDRESS$ -p $ARG1$ -l $ARG2$ -a $ARG3$ -w $ARG4$ -c $ARG5$
When I log on to the server and run taskmgr it reports the tomcat6.exe process consume 2,2 Mb of memory
When I take a look to nagios check it shows :
OK: memory in use 891 Mo (2043 Mo): threads[http-8180]=2(400):
How do you explain that ?
Re: check tomcat memory
Posted: Wed Feb 07, 2018 10:26 am
by mcapra
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.
check_tomcat.pl reports both what is currently being used and what is currently available
within the context of the JVM:
Code: Select all
push @message, sprintf("memory in use %d MiB (%d MiB);",
( $xpath_check_results{memMax} - $jvm_mem_available ) / ( 1024 * 1024),
$xpath_check_results{memMax} / ( 1024 * 1024)
);
And if you're curious about the discrepancy in what is reported as the JVM's available heap VS what windows is reporting the process is consuming,
2043MiB = 2142MB.
Re: check tomcat memory
Posted: Wed Feb 07, 2018 12:48 pm
by dwhitfield
Thanks
@mcapra!
OP, did you have any other questions?
Re: check tomcat memory
Posted: Thu Feb 08, 2018 3:16 am
by Frédéric GRANAT
Hi,
Sorry,That doesn't help me.
The software provider says that the Tomcat process consume constantly 2 Gb of memory
The following error message extracted from log (what log I don't know) :
java.lang.OutOfMemoryError: Java heap space
Nagios check check_tomcat.pl shows an average consumption of 600 Mb and some pikes at 1,9 Gb.
So I want to have an history of java heap space usage.
What kind of check should I use ?
Rgds,
Frederic
Re: check tomcat memory
Posted: Thu Feb 08, 2018 10:55 am
by npolovenko
[user]Frédéric GRANAT[/user], I believe our developers are working on another JVM plugin at the moment, and it should be released in a near future. In meantime, you can post your suggestions in this topic:
https://github.com/nagios-plugins/nagio ... issues/279
Also, if you would like to become a beta tester for this new JVM plugin let me know, and I'll try to connect you with the developer.
Re: check tomcat memory
Posted: Thu Feb 08, 2018 2:07 pm
by mcapra
Frédéric GRANAT wrote:
Nagios check check_tomcat.pl shows an average consumption of 600 Mb and some pikes at 1,9 Gb.
So I want to have an history of java heap space usage.
What kind of check should I use ?
Is check_tomcat.pl not currently reporting performance data to Nagios XI? I'm a bit confused; You should be getting historical memory usage from this plugin and there should be graphs of that usage on the service's status page. Is this not so?
I would assume those spikes upwards of 1,9GB are probably occurring around the same time the Tomcat process is running out of memory and producing that exception.
Re: check tomcat memory
Posted: Thu Feb 08, 2018 2:40 pm
by kyang
Could you also post or PM us your profile?
Nagios XI Profile --> On the XI Home Page click "Admin" > "System Profile" --> "Download Profile" button
Save the profile.zip file and upload it here or PM me.
If you receive a
PROFILE BUILD FAILED
Please follow this article,
https://support.nagios.com/kb/article.p ... ategory=44
After you PM the profile please update this thread, unless you post the profile on here. Thanks
Re: check tomcat memory
Posted: Fri Feb 09, 2018 2:41 am
by Frédéric GRANAT
Hi,
To MCapra :
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
Rgds,
Frederic
Re: check tomcat memory
Posted: Fri Feb 09, 2018 2:44 am
by Frédéric GRANAT
Hi,
Here is my system profile
Thanks
Re: check tomcat memory
Posted: Fri Feb 09, 2018 3:07 am
by Frédéric GRANAT
Hi,
To npovolenko : OK to beta test the new pluggin.
Frederic