<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>Hello,</p>
    <p>how much shared memory did you configure for kamailio (the value
      of -m parameter)? There are safety checks to ensure that there are
      available 256 to 512KB of shm/kamailio process in order to have
      safe ssl operations. If you don't allocate enough and you have a
      high value for children global parameter, then you can run easily
      into this constraint.</p>
    <p>You can provide the output of:</p>
    <p>kamctl ps</p>
    <p>kamctl stats</p>
    <p>if you want us to check if you allocated enough resources.<br>
    </p>
    Cheers,<br>
    Daniel<br>
    <br>
    <div class="moz-cite-prefix">On 22/12/2016 08:26, raja raja wrote:<br>
    </div>
    <blockquote
cite="mid:CACm4Fpmc8TAP+iaEscAAgqhpgEGsf8YFz2dBzT8F_ZP_N9eaWA@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>
          <div>
            <div>
              <div>
                <div>
                  <div>Hi,<br>
                  </div>
                  shared memory not freed once TLS connection close
                  means shm available memory decreasing for new
                  connection that leads to the following error<br>
                  <b>tls: ssl bug #1491 workaround: not enough memory
                    for safe operation<br>
                    <br>
                  </b></div>
                <div><b>TestCase:<br>
                  </b></div>
                1. start kamailio<br>
              </div>
              2. use sample program to establish tls connection and
              close imediately.<br>
            </div>
            3. Kamailio Log is<br>
          </div>
              For first TLS connection<br>
              tls [tls_server.c:189]: tls_complete_init(): tls: enough
          memory for safe operation: shm=63604096 threshold1=12058624<br>
              tls [tls_server.c:649]: tls_h_tcpconn_clean(): tls
          shm_available after shm_free: 63545192<br>
          <br>
               For second TLS connection<br>
               tls [tls_server.c:189]: tls_complete_init(): tls: enough
          memory for safe operation: shm=63545192 threshold1=12058624<br>
               tls [tls_server.c:649]: tls_h_tcpconn_clean(): tls
          shm_available after shm_free: 63489352<br>
          <b><br>
          </b></div>
        <b>Memory Leak:</b><br>
        <div>for tls connection connection<br>
        </div>
        <div>63604096 - 63545192 = 58904 bytes not freed.<br>
          <br>
          <div>for tls connection connection<br>
          </div>
          63545192 - 63489352 = 55840 bytes not freed.<br>
        </div>
        <div><br>
        </div>
        <div>I tested same scenario on kamailio - 4.2.4, 4.3.4 versions
          result is same.<br>
          <br>
        </div>
        <div>Could you please provide the fix?<br>
        </div>
        <div><br>
        </div>
        <div>Thanks & Regards,<br>
        </div>
        <div>Raja Chegondi.<br>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a>
Kamailio World Conference - May 8-10, 2017 - <a class="moz-txt-link-abbreviated" href="http://www.kamailioworld.com">www.kamailioworld.com</a></pre>
  </body>
</html>