<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Duane,<br>
<br>
trying to follow what you are saying :) - the mem leak you observe
is for system memory (when you look with top) or is opensips memory
(private or shared) ?<br>
<br>
Regards,<br>
Bogdan<br>
<br>
On 04/06/2011 06:18 AM, Duane Larson wrote:
<blockquote
cite="mid:BANLkTi=LLe_c3=QrkMOOE4te99=QaHkmRQ@mail.gmail.com"
type="cite">
<div>OK after more testing it looks like my current test config
with dialoginfo_set(); commented out is stable. My opensips
processes grow to around 8.1 and 7.9 via the top command and
stay there without growing anymore. Also I just found the
following command</div>
<div> </div>
<div>opensipsctl fifo get_statistics pkmem: shmem:</div>
<div> </div>
<div>Didn't know about it. After looking at that I see that I
have a good amount of free memory with all the pkmem's and the
shmem.</div>
<div> </div>
<div>As for all the records in the PUA table that is probably
because I have edited my script so much just to test calls per
second. I had disabled all my presence processing but forgot
to comment out the dialoginfo_set() function. Hopefully when I
am done stress testing the PUA stuff will not be an issue.</div>
<div> </div>
<div><br>
</div>
<div class="gmail_quote">On Tue, Apr 5, 2011 at 6:02 PM, Duane
Larson <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:duane.larson@gmail.com">duane.larson@gmail.com</a>></span>
wrote:<br>
<blockquote style="border-left: 1px solid rgb(204, 204, 204);
margin: 0px 0px 0px 0.8ex; padding-left: 1ex;"
class="gmail_quote">
<p>Thanks for the reply. I actually have been following the
directions on </p>
<div class="im"><br>
<a moz-do-not-send="true"
href="http://www.opensips.org/Resources/DocsTsMem"
target="_blank">http://www.opensips.org/Resources/DocsTsMem</a></div>
<p><br>
Perhaps my memory is building up because I am receiving a
ton of the following in my PUA database table</p>
<p>mysql> select * from pua;<br>
+--------+------------------+----------------+-------+---------+-----------------+------+------+----------+-------------+--------+---------+--------+----------+------+--------------+---------+----------------+---------+---------------+<br>
| id | pres_uri | pres_id | event |
expires | desired_expires | flag | etag | tuple_id |
watcher_uri | to_uri | call_id | to_tag | from_tag | cseq |
record_route | contact | remote_contact | version |
extra_headers |<br>
+--------+------------------+----------------+-------+---------+-----------------+------+------+----------+-------------+--------+---------+--------+----------+------+--------------+---------+----------------+---------+---------------+<br>
| 641966 | <a moz-do-not-send="true"
href="mailto:sip%3A102@test.com" target="_blank">sip:102@test.com</a>
| DIALOG_PUBLISH | 64 | 0 | 1302067600 | 1024
| | | | | |
| | 0 | | |
| 0 | |<br>
| 642014 | <a moz-do-not-send="true"
href="mailto:sip%3A102@test.com" target="_blank">sip:102@test.com</a>
| DIALOG_PUBLISH | 64 | 0 | 1302067599 | 1024
| | | | | |
| | 0 | | |
| 0 | |</p>
<p>This is because of the following function in my
opensips.cfg script</p>
<p>dialoginfo_set(); (using this so I can have the BLF
feature)</p>
<p>When I comment this out my script appears to run fine when
I stress test it with SIPP. I have the following<br>
children = 10<br>
Server has 1 Gig of RAM<br>
I configured my config.h to be "define PKG_MEM_POOL_SIZE
4*1024*1024"<br>
I execute the Opensips service with 128M of memory</p>
<p>I run my SIPP test for about 5 minutes and 30 seconds and
get the following outcome</p>
<p> Counter Name | Periodic value |
Cumulative value<br>
-------------------------+---------------------------+--------------------------<br>
Elapsed Time | 00:00:00:000 |
00:05:32:211 <br>
Call Rate | 0.000 cps |
18.455 cps <br>
-------------------------+---------------------------+--------------------------<br>
Incoming call created | 0
| 0 <br>
OutGoing call created | 0 |
6131 <br>
Total Call created | |
6131 <br>
Current Call | 0
| <br>
-------------------------+---------------------------+--------------------------<br>
Counter 5 | 0 |
6130 <br>
-------------------------+---------------------------+--------------------------<br>
Successful call | 0 |
6130 <br>
Failed call | 0
| 1 </p>
<p><br>
With this test I have nothing in my PUA table. Also at the
end of this test I see that I have the folllowing when I
execute the "top" command</p>
<p>Mem: 1022536k total, 785916k used, 236620k free,
29708k buffers<br>
Swap: 2097148k total, 0k used, 2097148k free,
457508k cached</p>
<p> PID USER PR NI VIRT RES SHR S %CPU %MEM
TIME+ COMMAND<br>
15327 mysql 20 0 333m 183m 10m S 1 18.4 9:24.24
mysqld<br>
1084 root 20 0 63012 15m 2788 S 0 1.5 0:00.28
opensips-mi-pro<br>
1096 root 20 0 73296 14m 3128 S 0 1.5 0:00.89
media-dispatche<br>
18654 opensips 20 0 283m 11m 9404 S 0 1.2 0:00.74
opensips<br>
18643 opensips 20 0 281m 11m 9464 S 0 1.2 0:01.07
opensips<br>
18647 opensips 20 0 281m 11m 9420 S 0 1.2 0:01.10
opensips<br>
18646 opensips 20 0 281m 11m 9376 S 0 1.2 0:01.09
opensips<br>
18649 opensips 20 0 281m 11m 9320 S 0 1.2 0:01.10
opensips<br>
18650 opensips 20 0 281m 11m 9284 S 0 1.1 0:01.12
opensips<br>
18651 opensips 20 0 281m 11m 9276 S 0 1.1 0:01.10
opensips<br>
18645 opensips 20 0 281m 11m 9272 S 0 1.1 0:01.10
opensips<br>
18644 opensips 20 0 281m 11m 9140 S 0 1.1 0:01.10
opensips<br>
18648 opensips 20 0 281m 11m 9076 S 0 1.1 0:01.08
opensips<br>
18652 opensips 20 0 281m 11m 8972 S 0 1.1 0:01.11
opensips<br>
18639 opensips 20 0 281m 8360 6096 S 0 0.8 0:00.09
opensips<br>
18640 opensips 20 0 283m 4120 1500 S 0 0.4 0:00.08
opensips<br>
18656 opensips 20 0 283m 4044 1760 S 0 0.4 0:00.12
opensips<br>
18641 opensips 20 0 281m 3448 1144 S 0 0.3 0:00.00
opensips<br>
18642 opensips 20 0 281m 3224 960 S 0 0.3 0:00.00
opensips<br>
18655 opensips 20 0 281m 3208 940 S 0 0.3 0:00.07
opensips<br>
18653 opensips 20 0 281m 2320 88 S 0 0.2 0:00.51
opensips </p>
<p> </p>
<p><br>
Then I run a second test with SIPP and get the following</p>
<div> Counter Name | Periodic value |
Cumulative value<br>
-------------------------+---------------------------+--------------------------<br>
Elapsed Time | 00:00:00:000 |
00:13:35:590 <br>
Call Rate | 0.000 cps |
77.586 cps <br>
-------------------------+---------------------------+--------------------------<br>
Incoming call created | 0
| 0 <br>
OutGoing call created | 0 |
63278 <br>
Total Call created | |
63278 <br>
Current Call | 0
| <br>
-------------------------+---------------------------+--------------------------<br>
Counter 5 | 0 |
63201 <br>
-------------------------+---------------------------+--------------------------<br>
Successful call | 0 |
63201 <br>
Failed call | 0 |
77 <br>
</div>
<div> </div>
<div> </div>
<div>And then when I do the "top" command again I see the
following</div>
<div> </div>
<div><font size="2">
<p>Mem: 1022536k total, 675176k used, 347360k
free, 30956k buffers<br>
Swap: 2097148k total, 0k used, 2097148k free,
345944k cached</p>
<p> PID USER PR NI VIRT RES SHR S %CPU %MEM
TIME+ COMMAND <br>
15327 mysql 20 0 333m 183m 10m S 1 18.4
12:29.06 mysqld<br>
18643 opensips 20 0 281m 28m 26m S 0 2.9
0:12.51 opensips<br>
18644 opensips 20 0 281m 28m 26m S 0 2.9
0:12.26 opensips<br>
18647 opensips 20 0 281m 28m 26m S 0 2.9
0:12.42 opensips <br>
18646 opensips 20 0 281m 28m 26m S 0 2.9
0:12.34 opensips<br>
18648 opensips 20 0 281m 28m 26m S 0 2.9
0:12.41 opensips<br>
18649 opensips 20 0 281m 28m 26m S 0 2.9
0:12.27 opensips<br>
18650 opensips 20 0 281m 28m 26m S 0 2.9
0:12.32 opensips<br>
18651 opensips 20 0 281m 28m 26m S 0 2.9
0:12.28 opensips<br>
18645 opensips 20 0 281m 28m 26m S 0 2.8
0:12.35 opensips<br>
18652 opensips 20 0 281m 28m 26m S 0 2.8
0:12.32 opensips<br>
18654 opensips 20 0 283m 26m 24m S 0 2.7
0:02.51 opensips<br>
1084 root 20 0 63012 15m 2788 S 0 1.5
0:00.28 opensips-mi-pro<br>
1096 root 20 0 73296 14m 3128 S 0 1.5
0:00.89 media-dispatche<br>
18642 opensips 20 0 281m 9860 7404 S 0 1.0
0:00.15 opensips<br>
18639 opensips 20 0 281m 8360 6096 S 0 0.8
0:00.09 opensips<br>
18640 opensips 20 0 283m 4192 1572 S 0 0.4
0:00.15 opensips<br>
18656 opensips 20 0 283m 4084 1800 S 0 0.4
0:00.25 opensips<br>
18641 opensips 20 0 281m 3448 1144 S 0 0.3
0:00.00 opensips<br>
18655 opensips 20 0 281m 3208 940 S 0 0.3
0:00.15 opensips<br>
18653 opensips 20 0 281m 2320 88 S 0 0.2
0:01.06 opensips </p>
<p> </p>
<p> So a lot of the opensips processes have about 2.9%
memory. I wait more than 20 minutes to see if the
memory would be released but it didn't.</p>
<p>Not sure if this is a bad thing or not. I could let my
SIPP test just keep running to see if OpenSIPS crashes
from no memory if the memory keeps creeping up or I
could do a "kill -SIGUSR1 18643" to see what is
currently using the memory? Any thoughts or is this not
an issue at all?</p>
<p> </p>
<p> </p>
</font></div>
<div>
<div class="h5">
<div class="gmail_quote">On Tue, Apr 5, 2011 at 4:31 AM,
Bogdan-Andrei Iancu <span dir="ltr"><<a
moz-do-not-send="true"
href="mailto:bogdan@opensips.org" target="_blank">bogdan@opensips.org</a>></span>
wrote:<br>
<blockquote style="border-left: 1px solid rgb(204, 204,
204); margin: 0px 0px 0px 0.8ex; padding-left: 1ex;"
class="gmail_quote">Hi Duane,
<div><br>
<br>
On 04/05/2011 06:54 AM, <a moz-do-not-send="true"
href="mailto:duane.larson@gmail.com"
target="_blank">duane.larson@gmail.com</a> wrote:<br>
<blockquote style="border-left: 1px solid rgb(204,
204, 204); margin: 0px 0px 0px 0.8ex;
padding-left: 1ex;" class="gmail_quote">A while
back I had posted on here thinking that i might
have a memory leak<br>
<a moz-do-not-send="true"
href="http://opensips-open-sip-server.1449251.n2.nabble.com/Memory-leak-td5942660.html#a5949293"
target="_blank">http://opensips-open-sip-server.1449251.n2.nabble.com/Memory-leak-td5942660.html#a5949293</a>
<br>
<br>
I've had to fix my SIPP scripts but also I had to
change some stuff in my opensips.cfg file. In my
script I commented out all of the times I set an
AVP variable.<br>
<br>
So my question is<br>
<br>
Every time you load an AVP it gets put into memory
correct?<br>
</blockquote>
</div>
yes, in shared memory, to be more specific.
<div><br>
<blockquote style="border-left: 1px solid rgb(204,
204, 204); margin: 0px 0px 0px 0.8ex;
padding-left: 1ex;" class="gmail_quote">So in
order for the memory not to get overloaded you
need to do "avp_delete" correct?<br>
</blockquote>
</div>
not necessarily - you use the function only only if
you want to delete the AVPs at some specific point in
script. AVPs are transaction/message persistent , and
they are automatically deleted when the transaction /
message is deleted (AVPs are part of
transaction/message)
<div><br>
<blockquote style="border-left: 1px solid rgb(204,
204, 204); margin: 0px 0px 0px 0.8ex;
padding-left: 1ex;" class="gmail_quote">What about
the AVPs that are declared in modparam's and that
are set in the script?<br>
</blockquote>
</div>
those are just names of AVPs, not instances of AVPs
<div><br>
<blockquote style="border-left: 1px solid rgb(204,
204, 204); margin: 0px 0px 0px 0.8ex;
padding-left: 1ex;" class="gmail_quote">How do you
make sure those are not overloading memory? What
else could cause my opensips processes to
gradually eat up the memory before opensips just
starts erroring out because of no memory?<br>
</blockquote>
</div>
As said, AVPs cannot cumulate in memory as they are
attached to structures (transactions/messages) that
are deleted.<br>
<br>
If you get errors on on running out of memory, please
read and follow:<br>
<a moz-do-not-send="true"
href="http://www.opensips.org/Resources/DocsTsMem"
target="_blank">http://www.opensips.org/Resources/DocsTsMem</a><br>
<br>
Regards,<br>
Bogdan<br>
<font color="#888888"><br>
<br>
-- <br>
Bogdan-Andrei Iancu<br>
OpenSIPS eBootcamp - 2nd of May 2011<br>
OpenSIPS solutions and "know-how"<br>
<br>
</font></blockquote>
</div>
<br>
<br clear="all">
<br>
</div>
</div>
-- <br>
--<br>
*--*--*--*--*--*<br>
Duane<br>
*--*--*--*--*--*<br>
<font color="#888888">--<br>
</font></blockquote>
</div>
<br>
<br clear="all">
<br>
-- <br>
--<br>
*--*--*--*--*--*<br>
Duane<br>
*--*--*--*--*--*<br>
--<br>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
Bogdan-Andrei Iancu
OpenSIPS eBootcamp - 2nd of May 2011
OpenSIPS solutions and "know-how"</pre>
</body>
</html>