<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p><font face="monospace">Hello,</font></p>
    <p><font face="monospace">2.8 gigs for 8.4M prefixes seems inline
        with expectation.  Assuming it was not reloading when you took
        this snapshot, 38M fragments means it does approx. 4 allocations
        per row -- which again, seems reasonable.  You could argue we
        could optimize it a little to hold each row in one chunk of mem,
        which will cut down into those 38M fragments - perhaps down to
        10-15M maybe?</font></p>
    <p><font face="monospace">Looking at fragments is not really
        helpful, as it's just metadata.  Instead, I'd look at the diff
        "real_used_size" and "used_size".  Here, it's saying 2G / 4.8G
        is effectively "wasted" using fragment metadata.  So that's a
        41% loss, mainly because each allocation is somewhat small, so
        it's comparable to the fragment metadata size itself.</font></p>
    <p><font face="monospace">TL;DR: unless we do some serious reworking
        to the drouting module (e.g. chunking multiple rows/prefixes to
        be allocated in one go, if that's even possible given the trie
        structure), that 41% mem wasted ratio will have to do.</font></p>
    <p><font face="monospace">Best regards,</font></p>
    <pre class="moz-signature" cols="72">Liviu Chircu
<a class="moz-txt-link-abbreviated" href="http://www.opensips-solutions.com">www.opensips-solutions.com</a> | <a class="moz-txt-link-abbreviated" href="http://www.siphub.com">www.siphub.com</a></pre>
    <div class="moz-cite-prefix">On 30/01/2026 14:14, <a class="moz-txt-link-abbreviated" href="mailto:spce@lard.at">spce@lard.at</a>
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:dfaff13d-58ec-469d-b850-33c14419d7b6@lard.at"><span
        style="color:#000000;background-color:#ffffff;">   <a class="moz-txt-link-rfc2396E" href="shmem:used_size">"shmem:used_size"</a>:
        2771791520,</span><span
        style="color:#000000;background-color:#ffffff;"> </span><br>
      <span style="color:#000000;background-color:#ffffff;">
           <a class="moz-txt-link-rfc2396E" href="shmem:real_used_size">"shmem:real_used_size"</a>: 4885528760,</span><span
        style="color:#000000;background-color:#ffffff;"> </span><br>
      <span style="color:#000000;background-color:#ffffff;">
           <a class="moz-txt-link-rfc2396E" href="shmem:fragments">"shmem:fragments"</a>: 37744704,</span></blockquote>
  </body>
</html>