Memory leak

Stanley Hopcroft Stanley.Hopcroft at IPAustralia.gov.au
Mon Apr 4 05:51:56 CEST 2005


Dear Sir,

I am writing to thank you for your letter and say,

On Sun, Apr 03, 2005 at 08:11:59PM -0700, nagios-users-request at lists.sourceforge.net wrote:
> 
> Message: 10
> Date: Sun, 03 Apr 2005 23:58:03 +0200
> From: Arno Lehmann <al at its-lehmann.de>
> To: "nagios-users at lists.sourceforge.net" <nagios-users at lists.sourceforge.net>
> Subject: [Nagios-users] Memory leak
> 
> Hello.
> 
> At the moment, I'm still playing with Nagios 2.0b2 while working on 
> migrating my monitoring stuff from a really old server to a moderately 
> old one :-)
> 
> One thing I notice:

> Whenever Nagios is running, the system seems to leak memory. No nagios 
> -> no problem. Nagios running -> Memory use rises and rises and rises... 
>   until I (or the kernel oom killer) kill Nagios. Then it stays on the 
> (too high) level.
> 
> In the mailing list, I found this reported as a known bug concerning 
> embedded perl, and in December Andreas wrote that one ugly leak was 
> fixed...should be in b2, shouldn't it?

There is an unfixed known bug using embedded Perl of this nature (see 
perldoc p1.pl).

You may have found a new leak.

> 
> Now, I'm wondering if this is a new bug, or a known issue - I couldn't 
> find anything in the documentation or release notes... on the other 
> hand, this should be obvious to others.
> 
> My configuration: Linux Kernel  2.6.8-24.13-default (SuSE 9.2), nagios 
> 2.0b2 just as downloaded, compiled without (to my knowledge...) perl 
> support.
> 

I think that something like this

tsitc> nm 
<path to build directory of Nag>/base/nagios 
| grep perl
0806c29c T deinit_embedded_perl
0806c1dc T init_embedded_perl
080a4068 d my_perl
         U perl_alloc
         U perl_construct
         U perl_destruct
         U perl_free
         U perl_parse
         U perl_run
080a406c D use_embedded_perl


will tell you if you have embedded Perl (if you see D use_embedded_perl, 
you have Perl compiled into your Nag).

> Everything else works as expected.
> 
> Unfortunately, I can't determine how the memory gets "eaten" - ps 
> doesn't tell me about any processes with huge RSSes. In fact, I can't be 
> sure that Nagios itself leaks that memory, but it happens if and only 
> when Nagios is running.

top does on this BSD host eg

tsitc> top -b 
last pid: 76931;  load averages:  0.35,  0.54,  0.56  up 86+19:09:22    
13:51:28
53 processes:  1 running, 52 sleeping

Mem: 100M Active, 27M Inact, 56M Wired, 16M Cache, 35M Buf, 51M Free
Swap: 256M Total, 9384K Used, 247M Free, 3% Inuse


  PID USERNAME       PRI NICE  SIZE    RES STATE    TIME   WCPU    CPU 
COMMAND
76927 nagios           2   0 28300K 21776K poll     0:00  2.73%  1.07% 
nagios
97772 nagios           2   0 26944K 20264K poll    37:41  0.68%  0.68% 
nagios


Likewise you could use check_procs from the standard plugin set to 
monitor vsz.


 
> I tried a configuration with 22 Hosts/22 Services, where the host checks 
>   use check_icmp and the services are mostly check_dummy and three 
> check_icmps. Check interval is 1 Minute during testing, 20 checks run in 
> parallel, and ~200MB "disappear" in about 2 hours (without any 
> notifications sent).
>

tsitc> file /usr/local/nagios/libexec/check_dummy 
/usr/local/nagios/libexec/check_dummy: ELF 32-bit LSB executable, Intel 
80386, version 1 (FreeBSD), for FreeBSD 4.1, dynamically linked (uses 
shared libs), not stripped
tsitc> 

check_icmp is C also.

If there is a problem it is in Nagios, not embedded Perl in this case.

 
> Any hints, clues, slutions, me toos?
> 
> Arno
> 
> 

Yours sincerely.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: disclaimer.txt
URL: <https://www.monitoring-lists.org/archive/users/attachments/20050404/e77ab5d5/attachment.txt>


More information about the Users mailing list