<!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>
&gt; Since 1.3.0 (now running 1.4.4) I'm seeing a very slow uptake of SHM<br>
&gt; memory on our low traffic setup (less than 5 cps per machine). I'm<br>
&gt; looking for some basis to go further on in my research to the cause. :)<br>
&gt;<br>
&gt; I compiled Kamailio 1.4.4-notls with #define SHM_MEM_SIZE 4*32 in<br>
&gt; config.h in production. For my testing setup I'm running on the standard<br>
&gt; 32 there.<br>
&gt;<br>
&gt; After about 3 weeks uptime I start top, sort on memory size and find the<br>
&gt; kamailio processes (I'm running with 16 children) to all have about 40mb<br>
&gt; in the SHR column. My understanding is that this should also go down,<br>
&gt; but it only goes up, slowly. More CPS (for example a benchmark using<br>
&gt; sipp) makes this go up faster, but it never seems to go down this<br>
&gt; figure. I think this is wrong, but I could be wrong myself. :)<br>
&gt;<br>
&gt; On a seperate machine with no traffic I compiled the memory debugging<br>
&gt; according to the "memory troubleshooting" page on the wiki. LOTS of info<br>
&gt; in the logs. Also ran with valgrind, didn't find anything interesting<br>
&gt; (but I'm no dev myself really).<br>
&gt;<br>
&gt; My plan now is to take away our acc module (compiled with radius<br>
&gt; support) and see if it's maybe that module that's causing this. My test<br>
&gt; on this traffic-less machine is as follows: start, run 20cps for a while<br>
&gt; (we do no registers, just routing and auth) and note the SHR data from<br>
&gt; top. Then according to my understanding this figure should drop down<br>
&gt; after a period of 20 minutes with no traffic. Is this a right assumption?<br>
&gt; [..]<br>
&gt; As far as I know, it never goes down, the SHR entries. When running with<br>
&gt; very little SHM i config.h, the process goes out of shm memory and<br>
&gt; complains, as expected.<br>
&gt;<br>
&gt; 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>