<p>This PR comes as a result to enabling MALLOC_STATS on 4.1 branch and noticing kamailio slowdown. On 4.1 the slowdown was happening because each time a memory function was called, iteration through all fragments happened upon <code>pkg_info</code>.</p>

<p>On master this is not happening anymore, because <code>qm->ffrags</code> variable counts the fragments "on the fly", while memory functions are called. Still, is it necessarily to call pkg_proc_update_stats() callback every time?!</p>

<p>Feel free to close this if not needed.</p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/kamailio/kamailio/pull/567'>https://github.com/kamailio/kamailio/pull/567</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>kex: Call pkg_proc_update_stats only when needed</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/kamailio/kamailio/pull/567/files#diff-0">events.c</a>
    (13)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/kamailio/kamailio/pull/567/files#diff-1">events.h</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/kamailio/kamailio/pull/567/files#diff-2">mem/f_malloc.c</a>
    (9)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/kamailio/kamailio/pull/567/files#diff-3">mem/q_malloc.c</a>
    (18)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/kamailio/kamailio/pull/567/files#diff-4">modules/kex/pkg_stats.c</a>
    (3)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/kamailio/kamailio/pull/567.patch'>https://github.com/kamailio/kamailio/pull/567.patch</a></li>
  <li><a href='https://github.com/kamailio/kamailio/pull/567.diff'>https://github.com/kamailio/kamailio/pull/567.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly or <a href="https://github.com/kamailio/kamailio/pull/567">view it on GitHub</a><img alt="" height="1" src="https://github.com/notifications/beacon/AF36ZQAnc2KNoEs81np8z6tAGWlTqh9Bks5p3lHAgaJpZM4IHcCr.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/kamailio/kamailio/pull/567"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>