<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Thanks for reporting back. After 4.2.0 release I will try to get the
time to release another 4.0.x version, to include this fix as well.<br>
<br>
Cheers,<br>
Daniel<br>
<br>
<div class="moz-cite-prefix">On 14/10/14 22:43, Heenan, Timothy
Steven wrote:<br>
</div>
<blockquote
cite="mid:2DB6BB728D67D3458F08F1E4AC6284942295E9@CWWAPP473.windstream.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<meta name="Generator" content="Microsoft Word 12 (filtered
medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]-->
<style><!--
/* Font Definitions */
@font-face
{font-family:Helvetica;
panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
{font-family:"Times New Roman \, serif";}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
color:black;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0in;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";
color:black;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Balloon Text Char";
margin:0in;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";
color:black;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
color:black;}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;
color:black;}
span.BalloonTextChar
{mso-style-name:"Balloon Text Char";
mso-style-priority:99;
mso-style-link:"Balloon Text";
font-family:"Tahoma","sans-serif";
color:black;}
span.EmailStyle22
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.EmailStyle23
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.EmailStyle24
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.EmailStyle25
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.EmailStyle26
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.EmailStyle27
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.EmailStyle28
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.EmailStyle29
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.EmailStyle30
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.EmailStyle31
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.EmailStyle32
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F497D">I’ve tested
this patch pretty thoroughly. Afterwards, I’ve pushed it to
our production environment and have not seen the problem
recur.
<o:p></o:p></span></p>
<p class="MsoNormal"><b><span style="color:#1F497D">This has
fixed the problem! <o:p>
</o:p></span></b></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Thanks for the
patch Daniel, I would definitely support its inclusion in a
backport for Kamailio 4.0.X .<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Thanks!<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">-Tim<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF
1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span
style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext">From:</span></b><span
style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext">
<a class="moz-txt-link-abbreviated" href="mailto:sr-users-bounces@lists.sip-router.org">sr-users-bounces@lists.sip-router.org</a>
[<a class="moz-txt-link-freetext" href="mailto:sr-users-bounces@lists.sip-router.org">mailto:sr-users-bounces@lists.sip-router.org</a>]
<b>On Behalf Of </b>Heenan, Timothy Steven<br>
<b>Sent:</b> Monday, September 15, 2014 10:50 AM<br>
<b>To:</b> '<a class="moz-txt-link-abbreviated" href="mailto:miconda@gmail.com">miconda@gmail.com</a>'; Kamailio (SER) - Users
Mailing List<br>
<b>Subject:</b> Re: [SR-Users] Kamailio 4.0.4 slow
memory leak<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="color:#1F497D">Thank you!<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">I will test
this on my 4.0.4 setup and report back how it works.
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Thank you, <o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><b><span
style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#8B8D8E">Tim
Heenan<o:p></o:p></span></b></p>
<p class="MsoNormal" style="text-autospace:none"><b><span
style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#7DBA00">Engineer
I - VoIP</span></b><span
style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D"></span><b><span
style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#7DBA00">Wholesale
| Windstream<o:p></o:p></span></b></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="color:#1F497D"><a moz-do-not-send="true"
href="mailto:email@windstream.com"><span
style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#8B8D8E">timothy.heenan@windstream.com</span></a></span><span
style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#8B8D8E">
| </span><span style="color:#1F497D"><a
moz-do-not-send="true"
href="http://www.windstreambusiness.com/"><span
style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#8B8D8E">windstreambusiness.com</span></a></span><span
style="font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#8B8D8E">o:
847.348.1338 | f: 847.963.0116<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF
1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span
style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext">From:</span></b><span
style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext">
Daniel-Constantin Mierla [<a moz-do-not-send="true"
href="mailto:miconda@gmail.com">mailto:miconda@gmail.com</a>]
<br>
<b>Sent:</b> Thursday, September 11, 2014 3:45 PM<br>
<b>To:</b> Heenan, Timothy Steven; Kamailio (SER) -
Users Mailing List<br>
<b>Subject:</b> Re: [SR-Users] Kamailio 4.0.4 slow
memory leak<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">I pushed a
patch to master branch, hopefully fixing the leak:<br>
<br>
- <a moz-do-not-send="true"
href="http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=7fb8c88c1d4aeb50d1e637697132ab0994dcdb28">http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=7fb8c88c1d4aeb50d1e637697132ab0994dcdb28</a><br>
<br>
Before backporting, I need to have it tested and be sure is
not having side effects.<br>
<br>
For 4.0.x, if you installed from sources, either try to cherry
pick the commit via git or edit the file:<br>
<br>
modules/dispatcher/dispatch.c <br>
<br>
and replace existing function destroy_list(...) with:<br>
<br>
void destroy_list(int list_id)<br>
{<br>
ds_set_t *sp = NULL;<br>
ds_set_t *sp1 = NULL;<br>
ds_dest_t *dest = NULL;<br>
<br>
sp = ds_lists[list_id];<br>
<br>
while(sp)<br>
{<br>
sp1 = sp->next;<br>
for(dest = sp->dlist; dest!= NULL;
dest=dest->next)<br>
{<br>
if(dest->uri.s!=NULL)<br>
{<br>
shm_free(dest->uri.s);<br>
dest->uri.s = NULL;<br>
}<br>
}<br>
if (sp->dlist != NULL)<br>
shm_free(sp->dlist);<br>
shm_free(sp);<br>
sp = sp1;<br>
}<br>
<br>
ds_lists[list_id] = NULL;<br>
}<br>
<br>
Let me know the results and if all ok, I will backport.<br>
<br>
Cheers,<br>
Daniel<o:p></o:p></p>
<div>
<p class="MsoNormal">On 11/09/14 18:03, Heenan, Timothy Steven
wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span style="color:#1F497D">Thanks for
your help Daniel!</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D">-Tim</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
<div>
<div style="border:none;border-top:solid #B5C4DF
1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span
style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext">From:</span></b><span
style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext">
Daniel-Constantin Mierla [<a moz-do-not-send="true"
href="mailto:miconda@gmail.com">mailto:miconda@gmail.com</a>]
<br>
<b>Sent:</b> Thursday, September 11, 2014 9:59 AM<br>
<b>To:</b> Heenan, Timothy Steven; Kamailio (SER) -
Users Mailing List<br>
<b>Subject:</b> Re: [SR-Users] Kamailio 4.0.4 slow
memory leak</span><o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">Short note
to say that last log you sent had more leads, and apparently
there is a leak at least in 4.0.<br>
<br>
I need a bit more time to look at it and check if still on
master and 4.1 (hopefully event later today) - I will come
back with an update about it soon.<br>
<br>
Daniel<o:p></o:p></p>
<div>
<p class="MsoNormal">On 08/09/14 18:11, Daniel-Constantin
Mierla wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal" style="margin-bottom:12.0pt">Were you
taking the memory logs after the errors, before
restarting?<br>
<br>
I didn't get the chance to look over the previous email, I
will do it soon.<br>
<br>
Daniel<o:p></o:p></p>
<div>
<p class="MsoNormal">On 08/09/14 17:48, Heenan, Timothy
Steven wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span style="color:#1F497D">After
restarting Kamailio on September 3rd, the problem has
again gotten to the point of no call processing.
<br>
<br>
Here are the memory statistics; additionally, I can
see the virtual memory has ballooned up to 400mb
again.
</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D">shmem:fragments
= 2378</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D">shmem:free_size
= 209840</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D">shmem:max_used_size
= 268393216</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D">shmem:real_used_size
= 268225616</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D">shmem:total_size
= 268435456</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D">shmem:used_size
= 220534792</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D">-Tim</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
<div>
<div style="border:none;border-top:solid #B5C4DF
1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span
style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext">From:</span></b><span
style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext">
<a moz-do-not-send="true"
href="mailto:sr-users-bounces@lists.sip-router.org">sr-users-bounces@lists.sip-router.org</a>
[<a moz-do-not-send="true"
href="mailto:sr-users-bounces@lists.sip-router.org">mailto:sr-users-bounces@lists.sip-router.org</a>]
<b>On Behalf Of </b>Heenan, Timothy Steven<br>
<b>Sent:</b> Wednesday, September 03, 2014 3:28 PM<br>
<b>To:</b> '<a moz-do-not-send="true"
href="mailto:miconda@gmail.com">miconda@gmail.com</a>';
Kamailio (SER) - Users Mailing List<br>
<b>Subject:</b> Re: [SR-Users] Kamailio 4.0.4 slow
memory leak</span><o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D">I have
about 460 destination sets. In each set I could have
from 1 address up to 6.
</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D">When I
took that initial memory log, Kamailio had been
restarted shortly beforehand. I just took another one
after the system had decayed so Kamailio was
responding to Invites with “SIP/2.0 500 No error
(2/SL).” (exhibiting the issue after a few days) and
the log is about 400Mb! I’ll attach a small snippet.
</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D">Seems to
be going on and on about the dispatcher module.
</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D">-Tim</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
<div>
<div style="border:none;border-top:solid #B5C4DF
1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span
style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext">From:</span></b><span
style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext">
Daniel-Constantin Mierla [<a
moz-do-not-send="true"
href="mailto:miconda@gmail.com">mailto:miconda@gmail.com</a>]
<br>
<b>Sent:</b> Thursday, August 28, 2014 5:03 AM<br>
<b>To:</b> Heenan, Timothy Steven; Kamailio (SER)
- Users Mailing List<br>
<b>Subject:</b> Re: [SR-Users] Kamailio 4.0.4 slow
memory leak</span><o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">Looking
at the logs, there are 1336 URIs, which seems ok given
your numbers, because the module keeps also the previous
set of records (needed because at reload time there can
be kamailio worker processes using the records --
perhaps we can improve a bit here, I will review the
current reload code a bit, since it was a contribution
from another developer quite long time ago).<br>
<br>
Some more questions:<br>
- how many destination sets (groups) do you have? Can
you estimate the minimum and maximum addresses in a set?<br>
- when did you take the memory log? In other words, for
how long was kamailio running? Did you wait enough to
notice the steady increase of memory usage?<br>
<br>
Cheers,<br>
Daniel<o:p></o:p></p>
<div>
<p class="MsoNormal">On 28/08/14 01:56, Heenan, Timothy
Steven wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span style="color:#1F497D">Thank
you for the help. </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D">For
dispatcher, I’m using a database that contains about
700 records.
</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D">A
reload is performed via cronjob every 5 minutes. The
command being used is:</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D">kamctl
dispatcher reload</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D">Thanks,</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D">-Tim</span><o:p></o:p></p>
</blockquote>
</blockquote>
</blockquote>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span
style="font-size:12.0pt;font-family:"Times New Roman
\, serif""><br>
<br>
</span><o:p></o:p></p>
<pre>-- <o:p></o:p></pre>
<pre>Daniel-Constantin Mierla<o:p></o:p></pre>
<pre><a moz-do-not-send="true" href="http://twitter.com/#%21/miconda">http://twitter.com/#!/miconda</a> - <a moz-do-not-send="true" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a><o:p></o:p></pre>
<pre>Next Kamailio Advanced Trainings 2014 - <a moz-do-not-send="true" href="http://www.asipto.com">http://www.asipto.com</a><o:p></o:p></pre>
<pre>Sep 22-25, Berlin, Germany<o:p></o:p></pre>
<div class="MsoNormal" style="text-align:center"
align="center"><span
style="font-size:12.0pt;font-family:"Times New
Roman","serif"">
<hr align="center" size="2" width="100%">
</span></div>
<p class="MsoNormal"><span
style="font-size:12.0pt;font-family:"Times New
Roman","serif"">This email message and any
attachments are for the sole use of the intended
recipient(s). Any unauthorized review, use, disclosure or
distribution is prohibited. If you are not the intended
recipient, please contact the sender by reply email and
destroy all copies of the original message and any
attachments.<o:p></o:p></span></p>
</blockquote>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span
style="font-size:12.0pt;font-family:"Times New
Roman","serif""><o:p> </o:p></span></p>
<pre>-- <o:p></o:p></pre>
<pre>Daniel-Constantin Mierla<o:p></o:p></pre>
<pre><a moz-do-not-send="true" href="http://twitter.com/#%21/miconda">http://twitter.com/#!/miconda</a> - <a moz-do-not-send="true" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a><o:p></o:p></pre>
<pre>Next Kamailio Advanced Trainings 2014 - <a moz-do-not-send="true" href="http://www.asipto.com">http://www.asipto.com</a><o:p></o:p></pre>
<pre>Sep 22-25, Berlin, Germany<o:p></o:p></pre>
</div>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Daniel-Constantin Mierla
<a class="moz-txt-link-freetext" href="http://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a></pre>
</body>
</html>