[OpenSIPS-Users] Memory Issues because of AVPs?

Bogdan-Andrei Iancu bogdan at opensips.org
Thu Apr 7 18:32:16 CEST 2011

Hi Duane,

On 04/06/2011 06:21 PM, duane.larson at gmail.com wrote:
> 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).
So what you are saying is the the memory outage was not because of a 
leak, but because of overload - to many calls because of your stress test.
Is this correct?

You can double-check this with a simple test - after you got the "no 
more mem" error, if you stop the traffic through opensips, in couple of 
minutes/hours, the memory should go back to normal values.

> 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
> opensipsctl fifo get_statistics pkmem: shmem:
> 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't get touched. So that 
> leads me to believe that my opensips processes have also stabilized 
> and aren't just gobbling up memory until it runs out. So even though 
> the TOP command appears to show that the opensips processes aren't 
> releasing that %MEM I can see with the opensipsctl fifo get_statistics 
> command that pkmem and shmem isn't growing and being overloaded.
> 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't bomb 
> out on me with memory issues.

What you need to understand is that opensips gets all the used memory 
(from OS) at startup and does not require any more mem from OS during 
runtime. All configured mem is allocated at startup (shm and pkg). So 
what TOP shows is irrelevant as at runtime there is no mem interaction 
with the system.
But there are modules using external libs (like libxml2) which still use 
system memory, so if you see opensips consuming more a more mem from 
system at runtime, it means that the leak is via such lib.


Bogdan-Andrei Iancu
OpenSIPS eBootcamp - 2nd of May 2011
OpenSIPS solutions and "know-how"

More information about the Users mailing list