<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2658.24">
<TITLE>RE: [Nagios-users] Nagios memory Leaks</TITLE>
</HEAD>
<BODY>
<BR>
<BR>

<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: nagios-users-bounces@lists.sourceforge.net</FONT>
<BR><FONT SIZE=2>[<A HREF="mailto:nagios-users-bounces@lists.sourceforge.net">mailto:nagios-users-bounces@lists.sourceforge.net</A>]On Behalf Of</FONT>
<BR><FONT SIZE=2>Stanley.Hopcroft@Dest.gov.au</FONT>
<BR><FONT SIZE=2>Sent: 24 January 2007 02:07</FONT>
<BR><FONT SIZE=2>To: nagios-users@lists.sourceforge.net</FONT>
<BR><FONT SIZE=2>Subject: [Nagios-users] Nagios memory Leaks</FONT>
</P>
<BR>

<P><FONT SIZE=2>Dear Sir,</FONT>
</P>

<P><FONT SIZE=2>I am writing to thank you for your valuable letter and say, </FONT>
</P>

<P><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2>> From: Tobias Klausmann <klausman@schwarzvogel.de></FONT>
<BR><FONT SIZE=2>> Subject: [Nagios-users] Memory leaks</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> Hi! </FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> (First off: if this should also go to nagios-devel, just yell at</FONT>
<BR><FONT SIZE=2>>  me.)</FONT>
<BR><FONT SIZE=2>></FONT>
</P>

<P><FONT SIZE=2>I don't think so because it deals with the aspects of the implementation</FONT>
<BR><FONT SIZE=2>that</FONT>
<BR><FONT SIZE=2>are visible (and in fact, the letter doesn't propose detailed</FONT>
<BR><FONT SIZE=2>solutions).</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2>> Nagios 2.6 and 2.5 have memory leaks. They are not that big that</FONT>
<BR><FONT SIZE=2>> within hours your machine will be swapping, but they degrade</FONT>
<BR><FONT SIZE=2>> performance in other ways.</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> First off, their approximate extent.</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> 2.5 and 2.6 without perl cache have the smallest memory leaks. A</FONT>
<BR><FONT SIZE=2>> fairly busy Nagios server (hardware quoted below) with about 3000</FONT>
<BR><FONT SIZE=2>> services on about 330 hosts will degrade from 330M used (that's</FONT>
<BR><FONT SIZE=2>> *not* Nagios alone) to 368M used in about 16 hours. Or about 2.4</FONT>
<BR><FONT SIZE=2>> MB per hour. The very same machine behaves neutral if Nagios is</FONT>
<BR><FONT SIZE=2>> not running, so it's definitely Nagios itself.</FONT>
</P>

<P><FONT SIZE=2>Do you mean: 2.5 and 2.6 Nagios with embedded Perl but without the</FONT>
<BR><FONT SIZE=2>Perl plugin cache option ?</FONT>
</P>

<P><FONT SIZE=2>If so, the fault is not Nagios, but the embedded Perl implementation and</FONT>
<BR><FONT SIZE=2>or Perl.</FONT>
</P>

<P><FONT SIZE=2>Your next paragraph suggest that this is plain vanilla Nagios without</FONT>
<BR><FONT SIZE=2>any Perl options to configure.</FONT>
</P>

<P><FONT SIZE=2>Is that correct ?</FONT>
</P>

<P><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> Activating the embedded Perl interpreter and -cache will increase</FONT>
<BR><FONT SIZE=2>> the amount of lost memory to about 5-6M per hour. In this case,</FONT>
<BR><FONT SIZE=2>> however, sometimes the memory usage snaps back, i.e. some of the</FONT>
<BR><FONT SIZE=2>> lost memory is collected. I've not yet found out what triggers</FONT>
<BR><FONT SIZE=2>> the reclaim. Still, over the course of hours, more and more</FONT>
<BR><FONT SIZE=2>> memory is lost. Still, it's roughly linear memory loss.</FONT>
<BR><FONT SIZE=2>> </FONT>
</P>

<P><FONT SIZE=2>I have never witnessed memory being reclaimed after ePN leaks it.</FONT>
</P>

<P><FONT SIZE=2>I can't conceive of the process memory size being reduced while the</FONT>
<BR><FONT SIZE=2>process is running (free() and friends only return the memory to the</FONT>
<BR><FONT SIZE=2>process</FONT>
<BR><FONT SIZE=2>heap).</FONT>
</P>

<P><FONT SIZE=2>I think the leak is caused by the ePN implementation. I a hoping to</FONT>
<BR><FONT SIZE=2>trying</FONT>
<BR><FONT SIZE=2>some measurements with several pilot implementations to see what is the</FONT>
<BR><FONT SIZE=2>most </FONT>
<BR><FONT SIZE=2>promising way of doing this.</FONT>
</P>

<P><FONT SIZE=2>... (snip)</FONT>
</P>

<P><FONT SIZE=2>Yep. I agree. The leak is bad.</FONT>
</P>
<BR>

<P><FONT SIZE=2>> The question that remains is, if this can (and will) be tackled</FONT>
<BR><FONT SIZE=2>> before 3.0 is released. A related question is if Nagios 3 will be</FONT>
<BR><FONT SIZE=2>> prone to the same problem.</FONT>
<BR><FONT SIZE=2>> </FONT>
</P>

<P><FONT SIZE=2>Certainly it will if the current ePN implementation remains.</FONT>
</P>

<P><FONT SIZE=2>If (pretty big if) I can provide you stuff to try are you willing</FONT>
<BR><FONT SIZE=2>to repeat your measurements on candidate implementations (wrt 2.5 or</FONT>
<BR><FONT SIZE=2>2.6 code base) ?</FONT>
</P>

<P><FONT SIZE=2>I am not sure of my willingness/energy quotient but if they look Ok,</FONT>
<BR><FONT SIZE=2>I may not have anything to show until March this year.</FONT>
</P>

<P><FONT SIZE=2>> Any thoughts, ideas etc. are appreciated.</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> Regards,</FONT>
<BR><FONT SIZE=2>> Tobias</FONT>
</P>

<P><FONT SIZE=2>Yours sincerely.</FONT>
</P>
<BR>
<BR>

<P><FONT SIZE=2>Morning !!</FONT>
</P>
<BR>

<P><FONT SIZE=2>I have been reading with interest about these memory leaks.</FONT>
<BR><FONT SIZE=2>I see you mention 2.5 & 2.6.</FONT>
<BR><FONT SIZE=2>Does this happen with 2.4 as well ??</FONT>
</P>

<P><FONT SIZE=2>Thanks !!!</FONT>
<BR><FONT SIZE=2>John</FONT>
</P>
<BR>

</BODY>
</HTML>