<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello everyone,<br>
    <br>
    We are thinking of a way to debug per module memory consumption
    (both private and shared). Something like a "kamctl fifo shmem<b> </b><b>module_name</b>"
    to print how much memory has been alloc'ed for that module and which
    function had alloc'ed. <br>
    <br>
    One of the solutions would be to make use of the shm_info() and
    pkg_info(), call them at the beginning and at the end of a function
    and do some subtraction at the end. Then correlate this data with a
    per module stats which will be printed with "kamctl stats <b>module_name</b>".
    This would be ok if one needs mem stats only for some specific
    modules.<br>
    <br>
    Another solution would be to make use of the *_malloc stubs used
    when MEM_DEBUG is enabled and keep the function name and size. Buf
    it would be hard to count how much memory is alloc'ed by the higher
    module function in scenarios when the actual allocations are done in
    other modules (e.g. db_allocate_rows()).<br>
    <br>
    Also we have in mind that one would not want to compile kamailio
    with MEM_DEBUG flag but still want to make use of the feature...<br>
    <br>
    If you think of some other solution or have some advices for this,
    please comment.<br>
    <br>
    Regards,<br>
    1&1 Team<br>
  </body>
</html>