Hey Daniel,<div><br></div><div><br><div class="gmail_quote">On Thu, Dec 2, 2010 at 12:45 AM, Daniel-Constantin Mierla <span dir="ltr">&lt;<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">


  
    
  
  <div bgcolor="#ffffff" text="#000000">
    Hello,<br>
    <br>
    sounds useful for live monitoring - is it ok to include it in our
    repository, kind of in utils folder?<br></div></blockquote><div><br></div><div>No problem.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div bgcolor="#ffffff" text="#000000">

    <br>
     The last version is able to print the summary of allocated
    fragments, a matter of mem_summary value:<br>
<a href="http://www.kamailio.org/dokuwiki/doku.php/core-cookbook:3.1.x#mem_summary" target="_blank">http://www.kamailio.org/dokuwiki/doku.php/core-cookbook:3.1.x#mem_summary</a><br>
    <br>
    Have you tried it?<br></div></blockquote><div><br></div><div>I havent yet, I am still stuck on Kamailio 1.5 - as we have MANY custom changes to it, so porting to later versions is quite a task. BUT as you mentioned the one I did helps me because it is LIVE. I can therefore do certain activities and effectively monitor what is happening with my memory in a nice &#39;at-a-glance&#39; manner. </div>
<div><br></div><div>p.s Please note the program I sent is obv. dependent on the format of the logfile because of the regex&#39;s in there.</div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div bgcolor="#ffffff" text="#000000">
    <br>
    Thanks,<br>
    Daniel<div><div></div><div class="h5"><br>
    <br>
    On 12/1/10 4:05 PM, Jason Penton wrote:
    </div></div><blockquote type="cite"><div><div></div><div class="h5">
      <div class="gmail_quote">Hi All,
        <div><br>
        </div>
        <div>thought I would give you a small little perl program I
          quickly hacked up to help with some memory leaks I was
          getting. Turns out I was forgetting to call release_urecord
          after a get_urecord on the usrloc module. Because I use
          Kamailio in DBOnly mode - the memory was never being freed.
          This little program helped me to find the source in no time at
          all. I hope it helps you too.</div>
        <div><br>
        </div>
        <div>A little info:</div>
        <div><br>
        </div>
        <div>The program works on the log file. NB you have to have
          memlog debugging enabled for this program to do anything
          useful. Effectively the program continuously monitors the log
          file looking for allocs and frees. It tallies all the
          fragments in use and gives a report of all the fragments and
          where they weer allocated. It also keeps a running counter of
          bytes used.</div>
        <div><br>
        </div>
        <div>Here is an example of the output:</div>
        <div>
          <div>*****************************************************************************************************************************************************</div>
          <div>DUMPING ALL UNFREED MEMORY FRAGMENTS (25)</div>
          <div>*****************************************************************************************************************************************************</div>
          <div>called from h_table.c: build_cell(251)                  
                                6                                      
                     21312</div>
          <div>called from dlg.c: new_dlg_uac(169)                      
                             1                                          
                 128</div>
          <div>called from t_msgbuilder.c: build_uac_req(921)          
                          6                                            
               1896</div>
          <div>called from pv_svar.c: set_var_value(104)                
                            3                                          
                 132</div>
          <div>called from ../../ut.h: shm_str_dup(501)                
                               2                                        
                   48</div>
          <div>called from reply.c: build_contact(127)                  
                               1                                        
                   132</div>
          <div>called from t_hooks.c: insert_tmcb(108)                  
                             6                                          
                 144</div>
          <div>************************************************************TOTAL
            BYTES HELD IN FRAGMENTS:
            23792***************************************************************</div>
        </div>
        <div><br>
        </div>
        <div>To use - simply untar into a directory and run ./<a href="http://memalyze.pl" target="_blank">memalyze.pl</a></div>
        <div><br>
        </div>
        <div>Hope it helps </div>
        <div><br>
        </div>
        <div>Cheers</div>
        <div>Jason</div>
        <font color="#888888">
          <div><br>
          </div>
          <div><br>
          </div>
          <div><br>
          </div>
        </font></div>
      <br>
      </div></div><pre><fieldset></fieldset>
_______________________________________________
sr-dev mailing list
<a href="mailto:sr-dev@lists.sip-router.org" target="_blank">sr-dev@lists.sip-router.org</a>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev</a>
</pre>
    </blockquote>
    <br>
    <pre cols="72">-- 
Daniel-Constantin Mierla
Kamailio (OpenSER) Advanced Training
Jan 24-26, 2011, Irvine, CA, USA
<a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a></pre>
  </div>

</blockquote></div><br></div>