Sorry for the confusion.  Orginally when I was testing my opensips config with the dialoginfo_set() function used in the script I was running into opensips memory (pk and sh) running out.  This is most likely due to the fact that a ton of records were building up in the PUA table because opensips was generating pua message because of the dialoginfo_set() even though I had commented out everything else in my opensips script that had to do with pua and presence.  I am hoping that when I am done with stress testing and enable all my presence and pua stuff the dialoginfo_set() functions will work as normal and not place a ton of records in the pua table (something I will need to verify later on).
<br />
<br />I think where I was getting confused was that when I did the top command I would see that my opensips processes were building up memory under the %MEM column and that number under %MEM was never decreasing after I waited 20 minutes.  Yet last night after doing more research via the mailing list I ran across the command
<br />
<br />opensipsctl fifo get_statistics pkmem: shmem:
<br />
<br />When I look at the info from that commands output I see that SHMEM does get memory back instead of just steadily running out.  I also see that with PKMEM all my processes are using about 1M of memory with 3M left over and that extra free memory doesn&#39;t get touched.  So that leads me to believe that my opensips processes have also stabilized and aren&#39;t just gobbling up memory until it runs out.  So even though the TOP command appears to show that the opensips processes aren&#39;t releasing that %MEM I can see with the opensipsctl fifo get_statistics command that pkmem and shmem isn&#39;t growing and being overloaded.
<br />
<br />Does that make more since?  Everything for now appears to be good.  I can run my SIPP test for a very long time and OpenSIPS doesn&#39;t bomb out on me with memory issues.
<br />
<br />On Apr 6, 2011 9:10am, Bogdan-Andrei Iancu &lt;bogdan@opensips.org&gt; wrote:
<br />&gt; 
<br />&gt; 
<br />&gt; 
<br />&gt; 
<br />&gt;   
<br />&gt; 
<br />&gt;     
<br />&gt; 
<br />&gt;   
<br />&gt; 
<br />&gt;   
<br />&gt; 
<br />&gt;     Duane,
<br />&gt; 
<br />&gt; 
<br />&gt;     
<br />&gt; 
<br />&gt; 
<br />&gt;     trying to follow what you are saying :) - the mem leak you observe
<br />&gt; 
<br />&gt;     is for system memory (when you look with top) or is opensips memory
<br />&gt; 
<br />&gt;     (private or shared) ?
<br />&gt; 
<br />&gt; 
<br />&gt;     
<br />&gt; 
<br />&gt; 
<br />&gt;     Regards,
<br />&gt; 
<br />&gt; 
<br />&gt;     Bogdan
<br />&gt; 
<br />&gt; 
<br />&gt;     
<br />&gt; 
<br />&gt; 
<br />&gt;     On 04/06/2011 06:18 AM, Duane Larson wrote:
<br />&gt; 
<br />&gt;     
<br />&gt; 
<br />&gt;       OK after more testing it looks like my current test config
<br />&gt; 
<br />&gt;         with dialoginfo_set();  commented out is stable.  My opensips
<br />&gt; 
<br />&gt;         processes grow to around 8.1 and 7.9 via the top command and
<br />&gt; 
<br />&gt;         stay there without growing anymore.  Also I just found the
<br />&gt; 
<br />&gt;         following command
<br />&gt; 
<br />&gt; 
<br />&gt;        
<br />&gt; 
<br />&gt; 
<br />&gt;       opensipsctl fifo get_statistics pkmem: shmem:
<br />&gt; 
<br />&gt; 
<br />&gt;        
<br />&gt; 
<br />&gt; 
<br />&gt;       Didn&#39;t know about it.  After looking at that I see that I
<br />&gt; 
<br />&gt;         have a good amount of free memory with all the pkmem&#39;s and the
<br />&gt; 
<br />&gt;         shmem.
<br />&gt; 
<br />&gt; 
<br />&gt;        
<br />&gt; 
<br />&gt; 
<br />&gt;       As for all the records in the PUA table that is probably
<br />&gt; 
<br />&gt;         because I have edited my script so much just to test calls per
<br />&gt; 
<br />&gt;         second. I had disabled all my presence processing but forgot
<br />&gt; 
<br />&gt;         to comment out the dialoginfo_set() function.  Hopefully when I
<br />&gt; 
<br />&gt;         am done stress testing the PUA stuff will not be an issue.
<br />&gt; 
<br />&gt; 
<br />&gt;        
<br />&gt; 
<br />&gt; 
<br />&gt;       
<br />&gt; 
<br />&gt; 
<br />&gt;          
<br />&gt; 
<br />&gt; 
<br />&gt;       On Tue, Apr 5, 2011 at 6:02 PM, Duane
<br />&gt; 
<br />&gt;         Larson duane.larson@gmail.com&gt;
<br />&gt; 
<br />&gt;         wrote:
<br />&gt; 
<br />&gt; 
<br />&gt;         
<br />&gt; 
<br />&gt;           
<br />&gt; Thanks for the reply.  I actually have been following the
<br />&gt; 
<br />&gt;             directions on 
<br />&gt; 
<br />&gt;           
<br />&gt; 
<br />&gt; 
<br />&gt;             http://www.opensips.org/Resources/DocsTsMem
<br />&gt; 
<br />&gt; 
<br />&gt;           
<br />&gt; 
<br />&gt; 
<br />&gt; 
<br />&gt;             Perhaps my memory is building up because I am receiving a
<br />&gt; 
<br />&gt;             ton of the following in my PUA database table
<br />&gt; 
<br />&gt;           
<br />&gt; mysql&gt; select * from pua;
<br />&gt; 
<br />&gt; 
<br />&gt; +--------+------------------+----------------+-------+---------+-----------------+------+------+----------+-------------+--------+---------+--------+----------+------+--------------+---------+----------------+---------+---------------+
<br />&gt; 
<br />&gt; 
<br />&gt;             | id     | pres_uri         | pres_id        | event |
<br />&gt; 
<br />&gt;             expires | desired_expires | flag | etag | tuple_id |
<br />&gt; 
<br />&gt;             watcher_uri | to_uri | call_id | to_tag | from_tag | cseq |
<br />&gt; 
<br />&gt;             record_route | contact | remote_contact | version |
<br />&gt; 
<br />&gt;             extra_headers |
<br />&gt; 
<br />&gt; 
<br />&gt; +--------+------------------+----------------+-------+---------+-----------------+------+------+----------+-------------+--------+---------+--------+----------+------+--------------+---------+----------------+---------+---------------+
<br />&gt; 
<br />&gt; 
<br />&gt;             | 641966 | sip:102@test.com
<br />&gt; 
<br />&gt;             | DIALOG_PUBLISH |    64 |       0 |      1302067600 | 1024
<br />&gt; 
<br />&gt;             |      |          |             |        |         |       
<br />&gt; 
<br />&gt;             |          |    0 |              |         |               
<br />&gt; 
<br />&gt;             |       0 |               |
<br />&gt; 
<br />&gt; 
<br />&gt;             | 642014 | sip:102@test.com
<br />&gt; 
<br />&gt;             | DIALOG_PUBLISH |    64 |       0 |      1302067599 | 1024
<br />&gt; 
<br />&gt;             |      |          |             |        |         |       
<br />&gt; 
<br />&gt;             |          |    0 |              |         |               
<br />&gt; 
<br />&gt;             |       0 |               |
<br />&gt; 
<br />&gt;           
<br />&gt; This is because of the following function in my
<br />&gt; 
<br />&gt;             opensips.cfg script
<br />&gt; 
<br />&gt;           
<br />&gt; dialoginfo_set();  (using this so I can have the BLF
<br />&gt; 
<br />&gt;             feature)
<br />&gt; 
<br />&gt;           
<br />&gt; When I comment this out my script appears to run fine when
<br />&gt; 
<br />&gt;             I stress test it with SIPP.  I have the following
<br />&gt; 
<br />&gt; 
<br />&gt;             children = 10
<br />&gt; 
<br />&gt; 
<br />&gt;             Server has 1 Gig of RAM
<br />&gt; 
<br />&gt; 
<br />&gt;             I configured my config.h to be &quot;define PKG_MEM_POOL_SIZE
<br />&gt; 
<br />&gt;             4*1024*1024&quot;
<br />&gt; 
<br />&gt; 
<br />&gt;             I execute the Opensips service with 128M of memory
<br />&gt; 
<br />&gt;           
<br />&gt; I run my SIPP test for about 5 minutes and 30 seconds and
<br />&gt; 
<br />&gt;             get the following outcome
<br />&gt; 
<br />&gt;           
<br />&gt;   Counter Name           | Periodic value            |
<br />&gt; 
<br />&gt;             Cumulative value
<br />&gt; 
<br />&gt; 
<br />&gt; -------------------------+---------------------------+--------------------------
<br />&gt; 
<br />&gt; 
<br />&gt;               Elapsed Time           | 00:00:00:000              |
<br />&gt; 
<br />&gt;             00:05:32:211             
<br />&gt; 
<br />&gt; 
<br />&gt;               Call Rate              |    0.000 cps              |  
<br />&gt; 
<br />&gt;             18.455 cps             
<br />&gt; 
<br />&gt; 
<br />&gt; -------------------------+---------------------------+--------------------------
<br />&gt; 
<br />&gt; 
<br />&gt;               Incoming call created  |        0                 
<br />&gt; 
<br />&gt;             |        0                 
<br />&gt; 
<br />&gt; 
<br />&gt;               OutGoing call created  |        0                  |    
<br />&gt; 
<br />&gt;             6131                 
<br />&gt; 
<br />&gt; 
<br />&gt;               Total Call created     |                           |    
<br />&gt; 
<br />&gt;             6131                 
<br />&gt; 
<br />&gt; 
<br />&gt;               Current Call           |        0                 
<br />&gt; 
<br />&gt;             |                          
<br />&gt; 
<br />&gt; 
<br />&gt; -------------------------+---------------------------+--------------------------
<br />&gt; 
<br />&gt; 
<br />&gt;               Counter 5              |        0                  |    
<br />&gt; 
<br />&gt;             6130                 
<br />&gt; 
<br />&gt; 
<br />&gt; -------------------------+---------------------------+--------------------------
<br />&gt; 
<br />&gt; 
<br />&gt;               Successful call        |        0                  |    
<br />&gt; 
<br />&gt;             6130                 
<br />&gt; 
<br />&gt; 
<br />&gt;               Failed call            |        0                 
<br />&gt; 
<br />&gt;             |        1 
<br />&gt; 
<br />&gt;           
<br />&gt; 
<br />&gt; 
<br />&gt; 
<br />&gt;             With this test I have nothing in my PUA table.  Also at the
<br />&gt; 
<br />&gt;             end of this test I see that I have the folllowing when I
<br />&gt; 
<br />&gt;             execute the &quot;top&quot; command
<br />&gt; 
<br />&gt;           
<br />&gt; Mem:   1022536k total,   785916k used,   236620k free,   
<br />&gt; 
<br />&gt;             29708k buffers
<br />&gt; 
<br />&gt; 
<br />&gt;             Swap:  2097148k total,        0k used,  2097148k free,  
<br />&gt; 
<br />&gt;             457508k cached
<br />&gt; 
<br />&gt;           
<br />&gt;   PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM   
<br />&gt; 
<br />&gt;             TIME+  COMMAND
<br />&gt; 
<br />&gt; 
<br />&gt;             15327 mysql     20   0  333m 183m  10m S    1 18.4   9:24.24
<br />&gt; 
<br />&gt;             mysqld
<br />&gt; 
<br />&gt; 
<br />&gt;              1084 root      20   0 63012  15m 2788 S    0  1.5   0:00.28
<br />&gt; 
<br />&gt;             opensips-mi-pro
<br />&gt; 
<br />&gt; 
<br />&gt;              1096 root      20   0 73296  14m 3128 S    0  1.5   0:00.89
<br />&gt; 
<br />&gt;             media-dispatche
<br />&gt; 
<br />&gt; 
<br />&gt;             18654 opensips  20   0  283m  11m 9404 S    0  1.2   0:00.74
<br />&gt; 
<br />&gt;             opensips
<br />&gt; 
<br />&gt; 
<br />&gt;             18643 opensips  20   0  281m  11m 9464 S    0  1.2   0:01.07
<br />&gt; 
<br />&gt;             opensips
<br />&gt; 
<br />&gt; 
<br />&gt;             18647 opensips  20   0  281m  11m 9420 S    0  1.2   0:01.10
<br />&gt; 
<br />&gt;             opensips
<br />&gt; 
<br />&gt; 
<br />&gt;             18646 opensips  20   0  281m  11m 9376 S    0  1.2   0:01.09
<br />&gt; 
<br />&gt;             opensips
<br />&gt; 
<br />&gt; 
<br />&gt;             18649 opensips  20   0  281m  11m 9320 S    0  1.2   0:01.10
<br />&gt; 
<br />&gt;             opensips
<br />&gt; 
<br />&gt; 
<br />&gt;             18650 opensips  20   0  281m  11m 9284 S    0  1.1   0:01.12
<br />&gt; 
<br />&gt;             opensips
<br />&gt; 
<br />&gt; 
<br />&gt;             18651 opensips  20   0  281m  11m 9276 S    0  1.1   0:01.10
<br />&gt; 
<br />&gt;             opensips
<br />&gt; 
<br />&gt; 
<br />&gt;             18645 opensips  20   0  281m  11m 9272 S    0  1.1   0:01.10
<br />&gt; 
<br />&gt;             opensips
<br />&gt; 
<br />&gt; 
<br />&gt;             18644 opensips  20   0  281m  11m 9140 S    0  1.1   0:01.10
<br />&gt; 
<br />&gt;             opensips
<br />&gt; 
<br />&gt; 
<br />&gt;             18648 opensips  20   0  281m  11m 9076 S    0  1.1   0:01.08
<br />&gt; 
<br />&gt;             opensips
<br />&gt; 
<br />&gt; 
<br />&gt;             18652 opensips  20   0  281m  11m 8972 S    0  1.1   0:01.11
<br />&gt; 
<br />&gt;             opensips
<br />&gt; 
<br />&gt; 
<br />&gt;             18639 opensips  20   0  281m 8360 6096 S    0  0.8   0:00.09
<br />&gt; 
<br />&gt;             opensips
<br />&gt; 
<br />&gt; 
<br />&gt;             18640 opensips  20   0  283m 4120 1500 S    0  0.4   0:00.08
<br />&gt; 
<br />&gt;             opensips
<br />&gt; 
<br />&gt; 
<br />&gt;             18656 opensips  20   0  283m 4044 1760 S    0  0.4   0:00.12
<br />&gt; 
<br />&gt;             opensips
<br />&gt; 
<br />&gt; 
<br />&gt;             18641 opensips  20   0  281m 3448 1144 S    0  0.3   0:00.00
<br />&gt; 
<br />&gt;             opensips
<br />&gt; 
<br />&gt; 
<br />&gt;             18642 opensips  20   0  281m 3224  960 S    0  0.3   0:00.00
<br />&gt; 
<br />&gt;             opensips
<br />&gt; 
<br />&gt; 
<br />&gt;             18655 opensips  20   0  281m 3208  940 S    0  0.3   0:00.07
<br />&gt; 
<br />&gt;             opensips
<br />&gt; 
<br />&gt; 
<br />&gt;             18653 opensips  20   0  281m 2320   88 S    0  0.2   0:00.51
<br />&gt; 
<br />&gt;             opensips 
<br />&gt; 
<br />&gt;           
<br />&gt;  
<br />&gt; 
<br />&gt;           
<br />&gt; 
<br />&gt; 
<br />&gt; 
<br />&gt;             Then I run a second test with SIPP and get the following
<br />&gt; 
<br />&gt;             Counter Name           | Periodic value            |
<br />&gt; 
<br />&gt;             Cumulative value
<br />&gt; 
<br />&gt; 
<br />&gt; -------------------------+---------------------------+--------------------------
<br />&gt; 
<br />&gt; 
<br />&gt;               Elapsed Time           | 00:00:00:000              |
<br />&gt; 
<br />&gt;             00:13:35:590             
<br />&gt; 
<br />&gt; 
<br />&gt;               Call Rate              |    0.000 cps              |  
<br />&gt; 
<br />&gt;             77.586 cps             
<br />&gt; 
<br />&gt; 
<br />&gt; -------------------------+---------------------------+--------------------------
<br />&gt; 
<br />&gt; 
<br />&gt;               Incoming call created  |        0                 
<br />&gt; 
<br />&gt;             |        0                 
<br />&gt; 
<br />&gt; 
<br />&gt;               OutGoing call created  |        0                  |   
<br />&gt; 
<br />&gt;             63278                 
<br />&gt; 
<br />&gt; 
<br />&gt;               Total Call created     |                           |   
<br />&gt; 
<br />&gt;             63278                 
<br />&gt; 
<br />&gt; 
<br />&gt;               Current Call           |        0                 
<br />&gt; 
<br />&gt;             |                          
<br />&gt; 
<br />&gt; 
<br />&gt; -------------------------+---------------------------+--------------------------
<br />&gt; 
<br />&gt; 
<br />&gt;               Counter 5              |        0                  |   
<br />&gt; 
<br />&gt;             63201                 
<br />&gt; 
<br />&gt; 
<br />&gt; -------------------------+---------------------------+--------------------------
<br />&gt; 
<br />&gt; 
<br />&gt;               Successful call        |        0                  |   
<br />&gt; 
<br />&gt;             63201                 
<br />&gt; 
<br />&gt; 
<br />&gt;               Failed call            |        0                  |      
<br />&gt; 
<br />&gt;             77 
<br />&gt; 
<br />&gt; 
<br />&gt;           
<br />&gt; 
<br />&gt; 
<br />&gt;            
<br />&gt; 
<br />&gt; 
<br />&gt;            
<br />&gt; 
<br />&gt; 
<br />&gt;           And then when I do the &quot;top&quot; command again I see the
<br />&gt; 
<br />&gt;             following
<br />&gt; 
<br />&gt; 
<br />&gt;            
<br />&gt; 
<br />&gt; 
<br />&gt;           
<br />&gt; 
<br />&gt;               
<br />&gt; Mem:   1022536k total,   675176k used,   347360k
<br />&gt; 
<br />&gt;                 free,    30956k buffers
<br />&gt; 
<br />&gt; 
<br />&gt;                 Swap:  2097148k total,        0k used,  2097148k free,  
<br />&gt; 
<br />&gt;                 345944k cached
<br />&gt; 
<br />&gt;               
<br />&gt;   PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM   
<br />&gt; 
<br />&gt;                 TIME+  COMMAND 
<br />&gt; 
<br />&gt; 
<br />&gt;                 15327 mysql     20   0  333m 183m  10m S    1 18.4 
<br />&gt; 
<br />&gt;                 12:29.06 mysqld
<br />&gt; 
<br />&gt; 
<br />&gt;                 18643 opensips  20   0  281m  28m  26m S    0  2.9  
<br />&gt; 
<br />&gt;                 0:12.51 opensips
<br />&gt; 
<br />&gt; 
<br />&gt;                 18644 opensips  20   0  281m  28m  26m S    0  2.9  
<br />&gt; 
<br />&gt;                 0:12.26 opensips
<br />&gt; 
<br />&gt; 
<br />&gt;                 18647 opensips  20   0  281m  28m  26m S    0  2.9  
<br />&gt; 
<br />&gt;                 0:12.42 opensips 
<br />&gt; 
<br />&gt; 
<br />&gt;                 18646 opensips  20   0  281m  28m  26m S    0  2.9  
<br />&gt; 
<br />&gt;                 0:12.34 opensips
<br />&gt; 
<br />&gt; 
<br />&gt;                 18648 opensips  20   0  281m  28m  26m S    0  2.9  
<br />&gt; 
<br />&gt;                 0:12.41 opensips
<br />&gt; 
<br />&gt; 
<br />&gt;                 18649 opensips  20   0  281m  28m  26m S    0  2.9  
<br />&gt; 
<br />&gt;                 0:12.27 opensips
<br />&gt; 
<br />&gt; 
<br />&gt;                 18650 opensips  20   0  281m  28m  26m S    0  2.9  
<br />&gt; 
<br />&gt;                 0:12.32 opensips
<br />&gt; 
<br />&gt; 
<br />&gt;                 18651 opensips  20   0  281m  28m  26m S    0  2.9  
<br />&gt; 
<br />&gt;                 0:12.28 opensips
<br />&gt; 
<br />&gt; 
<br />&gt;                 18645 opensips  20   0  281m  28m  26m S    0  2.8  
<br />&gt; 
<br />&gt;                 0:12.35 opensips
<br />&gt; 
<br />&gt; 
<br />&gt;                 18652 opensips  20   0  281m  28m  26m S    0  2.8  
<br />&gt; 
<br />&gt;                 0:12.32 opensips
<br />&gt; 
<br />&gt; 
<br />&gt;                 18654 opensips  20   0  283m  26m  24m S    0  2.7  
<br />&gt; 
<br />&gt;                 0:02.51 opensips
<br />&gt; 
<br />&gt; 
<br />&gt;                  1084 root      20   0 63012  15m 2788 S    0  1.5  
<br />&gt; 
<br />&gt;                 0:00.28 opensips-mi-pro
<br />&gt; 
<br />&gt; 
<br />&gt;                  1096 root      20   0 73296  14m 3128 S    0  1.5  
<br />&gt; 
<br />&gt;                 0:00.89 media-dispatche
<br />&gt; 
<br />&gt; 
<br />&gt;                 18642 opensips  20   0  281m 9860 7404 S    0  1.0  
<br />&gt; 
<br />&gt;                 0:00.15 opensips
<br />&gt; 
<br />&gt; 
<br />&gt;                 18639 opensips  20   0  281m 8360 6096 S    0  0.8  
<br />&gt; 
<br />&gt;                 0:00.09 opensips
<br />&gt; 
<br />&gt; 
<br />&gt;                 18640 opensips  20   0  283m 4192 1572 S    0  0.4  
<br />&gt; 
<br />&gt;                 0:00.15 opensips
<br />&gt; 
<br />&gt; 
<br />&gt;                 18656 opensips  20   0  283m 4084 1800 S    0  0.4  
<br />&gt; 
<br />&gt;                 0:00.25 opensips
<br />&gt; 
<br />&gt; 
<br />&gt;                 18641 opensips  20   0  281m 3448 1144 S    0  0.3  
<br />&gt; 
<br />&gt;                 0:00.00 opensips
<br />&gt; 
<br />&gt; 
<br />&gt;                 18655 opensips  20   0  281m 3208  940 S    0  0.3  
<br />&gt; 
<br />&gt;                 0:00.15 opensips
<br />&gt; 
<br />&gt; 
<br />&gt;                 18653 opensips  20   0  281m 2320   88 S    0  0.2  
<br />&gt; 
<br />&gt;                 0:01.06 opensips  
<br />&gt; 
<br />&gt;               
<br />&gt;  
<br />&gt; 
<br />&gt;               
<br />&gt;  So a lot of the opensips processes have about 2.9%
<br />&gt; 
<br />&gt;                 memory.  I wait more than 20 minutes to see if the
<br />&gt; 
<br />&gt;                 memory would be released but it didn&#39;t.
<br />&gt; 
<br />&gt;               
<br />&gt; Not sure if this is a bad thing or not.  I could let my
<br />&gt; 
<br />&gt;                 SIPP test just keep running to see if OpenSIPS crashes
<br />&gt; 
<br />&gt;                 from no memory if the memory keeps creeping up or I
<br />&gt; 
<br />&gt;                 could do a &quot;kill -SIGUSR1 18643&quot; to see what is
<br />&gt; 
<br />&gt;                 currently using the memory?  Any thoughts or is this not
<br />&gt; 
<br />&gt;                 an issue at all?
<br />&gt; 
<br />&gt;               
<br />&gt;  
<br />&gt; 
<br />&gt;               
<br />&gt;  
<br />&gt; 
<br />&gt;             
<br />&gt; 
<br />&gt; 
<br />&gt;           
<br />&gt; 
<br