<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;
      charset=windows-1252">
  </head>
  <body>
    <font face="monospace">Hi all,<br>
      <br>
      As a quick update, thanks to Arto's help and troubleshooting, a
      mem leak was indeed identified.<br>
      <br>
      The fix is now available on all versions.<br>
      <br>
      <a class="moz-txt-link-freetext"
href="https://github.com/OpenSIPS/opensips/commit/f07e90aac92f33d3321d73ed69ca19850b7e10b4">https://github.com/OpenSIPS/opensips/commit/f07e90aac92f33d3321d73ed69ca19850b7e10b4</a><br>
      <br>
      Best regards,</font>
    <pre class="moz-signature" cols="72">Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  <a class="moz-txt-link-freetext" href="https://www.opensips-solutions.com">https://www.opensips-solutions.com</a>
OpenSIPS Bootcamp 5-16 Dec 2022, online
  <a class="moz-txt-link-freetext" href="https://www.opensips.org/training/OpenSIPS_eBootcamp_2022/">https://www.opensips.org/training/OpenSIPS_eBootcamp_2022/</a></pre>
    <div class="moz-cite-prefix">On 10/10/22 4:55 PM, Arto Kuiri wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:AS8P191MB1413908DA53E65912884E7259E209@AS8P191MB1413.EURP191.PROD.OUTLOOK.COM">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <style type="text/css" style="display:none;">P {margin-top:0;margin-bottom:0;}</style>
      <div style="font-family: Calibri, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
        Hi,</div>
      <div style="font-family: Calibri, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
        <br>
      </div>
      <div style="font-family: Calibri, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
        Yes, that is where memory leak seams to be. This happens in all
        SIP udp receiver processes.</div>
      <div style="font-family: Calibri, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
        <br>
      </div>
      <div style="font-family: Calibri, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
        I can provide logs and config etc offlist.</div>
      <div style="font-family: Calibri, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
        <br>
      </div>
      <div style="font-family: Calibri, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
        -Arto<br>
      </div>
      <hr style="display:inline-block;width:98%" tabindex="-1">
      <div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt"
          face="Calibri, sans-serif" color="#000000"><b>Lähettäjä:</b>
          Bogdan-Andrei Iancu <a class="moz-txt-link-rfc2396E" href="mailto:bogdan@opensips.org"><bogdan@opensips.org></a><br>
          <b>Lähetetty:</b> maanantai 10. lokakuuta 2022 16.33<br>
          <b>Vastaanottaja:</b> OpenSIPS users mailling list
          <a class="moz-txt-link-rfc2396E" href="mailto:users@lists.opensips.org"><users@lists.opensips.org></a>; Arto Kuiri
          <a class="moz-txt-link-rfc2396E" href="mailto:art666@hotmail.com"><art666@hotmail.com></a><br>
          <b>Aihe:</b> Re: [OpenSIPS-Users] Possible memory leak in PKG</font>
        <div> </div>
      </div>
      <div><font face="monospace">Hi Arto,<br>
          <br>
          Thanks for the report here. So, the 3.2.7 suffers of a mem
          leak which DOES NOT exist in 3.1.1, mainly this
          <br>
        </font><br>
        <font face="monospace">      109600 : 4858 x [dlg_vals.c:
          fetch_dlg_value, line 176]<br>
          <br>
          right ?<br>
          <br>
          Best regards,<br>
        </font>
        <pre class="x_moz-signature" cols="72">Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  <a class="x_moz-txt-link-freetext" href="https://www.opensips-solutions.com" moz-do-not-send="true">https://www.opensips-solutions.com</a>
OpenSIPS Summit 27-30 Sept 2022, Athens
  <a class="x_moz-txt-link-freetext" href="https://www.opensips.org/events/Summit-2022Athens/" moz-do-not-send="true">https://www.opensips.org/events/Summit-2022Athens/</a></pre>
        <div class="x_moz-cite-prefix">On 10/5/22 10:16 AM, Arto Kuiri
          wrote:<br>
        </div>
        <blockquote type="cite">
          <style type="text/css" style="display:none">p
        {margin-top:0;
        margin-bottom:0}</style>
          <div class="x_elementToProof x_ContentPasted0"
            style="font-family:Calibri,Helvetica,sans-serif;
            font-size:12pt; color:rgb(0,0,0)">
            Hi,
            <div><br class="x_ContentPasted0">
            </div>
            <div class="x_ContentPasted0">I think I have stumbled to
              some kind of memory leak. I made new opensips server used
              same opensips.cfg (changed only ip address) as in my older
              servers and after some time I started to get these to log
              file:</div>
            <div><br class="x_ContentPasted0">
            </div>
            <div class="x_ContentPasted0">/usr/sbin/opensips[1145854]:
              ERROR:core:fm_malloc: not enough free pkg memory (2312
              bytes left, need 2472), please increase the "-M" command
              line parameter!</div>
            <div class="x_ContentPasted0">/usr/sbin/opensips[1145854]:
              ERROR:core:receive_msg: no pkg mem left for sip_msg</div>
            <div><br class="x_ContentPasted0">
            </div>
            <div class="x_ContentPasted0">Older servers works fine with
              much higher load. Old servers are with opensips 3.1.1 and
              new server is 3.2.7 :</div>
            <div><br class="x_ContentPasted0">
            </div>
            <div class="x_ContentPasted0">opensips -V</div>
            <div class="x_ContentPasted0">version: opensips 3.1.1
              (x86_64/linux)</div>
            <div class="x_ContentPasted0">flags: STATS: On,
              DISABLE_NAGLE, USE_MCAST, SHM_MMAP, PKG_MALLOC, Q_MALLOC,
              F_MALLOC, HP_MALLOC, DBG_MALLOC, FAST_LOCK-ADAPTIVE_WAIT</div>
            <div class="x_ContentPasted0">ADAPTIVE_WAIT_LOOPS=1024,
              MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE
              1024, BUF_SIZE 65535</div>
            <div class="x_ContentPasted0">poll method support: poll,
              epoll, sigio_rt, select.</div>
            <div class="x_ContentPasted0">main.c compiled on  with gcc 9</div>
            <div><br class="x_ContentPasted0">
            </div>
            <div class="x_ContentPasted0">opensips -V</div>
            <div class="x_ContentPasted0">version: opensips 3.2.7
              (x86_64/linux)</div>
            <div class="x_ContentPasted0">flags: STATS: On,
              DISABLE_NAGLE, USE_MCAST, SHM_MMAP, PKG_MALLOC, Q_MALLOC,
              F_MALLOC, HP_MALLOC, DBG_MALLOC, FAST_LOCK-ADAPTIVE_WAIT</div>
            <div class="x_ContentPasted0">ADAPTIVE_WAIT_LOOPS=1024,
              MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE
              1024, BUF_SIZE 65535</div>
            <div class="x_ContentPasted0">poll method support: poll,
              epoll, sigio_rt, select.</div>
            <div class="x_ContentPasted0">main.c compiled on  with gcc
              11</div>
            <div><br class="x_ContentPasted0">
            </div>
            <div class="x_ContentPasted0">I allocated more memory and
              changed private memory allocator to F_MALLOC_DBG</div>
            <div><br class="x_ContentPasted0">
            </div>
            <div class="x_ContentPasted0">After while I checked what
              process had highest memory useage and I did:</div>
            <div class="x_ContentPasted0">opensips-cli -x mi
              mem_pkg_dump <pid></div>
            <div class="x_ContentPasted1">(PID was "SIP receiver udp")</div>
            <br>
          </div>
        </blockquote>
        <br>
      </div>
    </blockquote>
    <br>
  </body>
</html>