<p>Thanks for the reply.  I actually have been following the directions on<br><a href="http://www.opensips.org/Resources/DocsTsMem" target="_blank">http://www.opensips.org/Resources/DocsTsMem</a></p>
<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&gt; 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 href="mailto:sip%3A102@test.com" target="_blank">sip:102@test.com</a> | DIALOG_PUBLISH |    64 |       0 |      1302067600 | 1024 |      |          |             |        |         |        |          |    0 |              |         |                |       0 |               |<br>
| 642014 | <a 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 &quot;define PKG_MEM_POOL_SIZE 4*1024*1024&quot;<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 &quot;top&quot; 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 &quot;top&quot; 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&#39;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 &quot;kill -SIGUSR1 18643&quot; 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 class="gmail_quote">On Tue, Apr 5, 2011 at 4:31 AM, Bogdan-Andrei Iancu <span dir="ltr">&lt;<a href="mailto:bogdan@opensips.org" target="_blank">bogdan@opensips.org</a>&gt;</span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; 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 href="mailto:duane.larson@gmail.com" target="_blank">duane.larson@gmail.com</a> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; 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 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&#39;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: #ccc 1px solid; 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 &quot;avp_delete&quot; 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: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">What about the AVPs that are declared in modparam&#39;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: #ccc 1px solid; 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 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 &quot;know-how&quot;<br><br></font></blockquote></div><br><br clear="all">
<br>-- <br>--<br>*--*--*--*--*--*<br>Duane<br>*--*--*--*--*--*<br>--<br>