<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"><html><head><meta name="qrichtext" content="1" /><style type="text/css">p, li { white-space: pre-wrap; }</style></head><body style=" font-family:'Lucida Console'; font-size:9pt; font-weight:400; font-style:normal;">On Freitag, 6. November 2009, Robin Vleij wrote:<br>
> Since 1.3.0 (now running 1.4.4) I'm seeing a very slow uptake of SHM<br>
> memory on our low traffic setup (less than 5 cps per machine). I'm<br>
> looking for some basis to go further on in my research to the cause. :)<br>
><br>
> I compiled Kamailio 1.4.4-notls with #define SHM_MEM_SIZE 4*32 in<br>
> config.h in production. For my testing setup I'm running on the standard<br>
> 32 there.<br>
><br>
> After about 3 weeks uptime I start top, sort on memory size and find the<br>
> kamailio processes (I'm running with 16 children) to all have about 40mb<br>
> in the SHR column. My understanding is that this should also go down,<br>
> but it only goes up, slowly. More CPS (for example a benchmark using<br>
> sipp) makes this go up faster, but it never seems to go down this<br>
> figure. I think this is wrong, but I could be wrong myself. :)<br>
><br>
> On a seperate machine with no traffic I compiled the memory debugging<br>
> according to the "memory troubleshooting" page on the wiki. LOTS of info<br>
> in the logs. Also ran with valgrind, didn't find anything interesting<br>
> (but I'm no dev myself really).<br>
><br>
> My plan now is to take away our acc module (compiled with radius<br>
> support) and see if it's maybe that module that's causing this. My test<br>
> on this traffic-less machine is as follows: start, run 20cps for a while<br>
> (we do no registers, just routing and auth) and note the SHR data from<br>
> top. Then according to my understanding this figure should drop down<br>
> after a period of 20 minutes with no traffic. Is this a right assumption?<br>
> [..]<br>
> As far as I know, it never goes down, the SHR entries. When running with<br>
> very little SHM i config.h, the process goes out of shm memory and<br>
> complains, as expected.<br>
><br>
> Are my assumptions about all of this correct?<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>Hello Robin,<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>do you experience any problems in your setup when you use a reasonable SHM mem size? In my experience the size of the SHM memory (as displayed from top) depends on the load of the machine. But there is a certain level of shared memory that is used regardless of the load. Even if the machine has been completely passive over a longer time, it will not reclaim this memory. On a certain test system for example there is one process that has 11MB SHM at the moment, even if its completely idle.<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>For the VIRT column (again top) its another story, here it will just show something like SHM + PKG memory size, regardless of the actual load. <br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>If you've a real memory leak in shared memory then after a certain time interval the server will report memory allocation errors. Otherwise i don't think its something to worry about.<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>Regards,<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>Henning</p></body></html>