<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">On Oct 19, 2015, at 3:10 AM, Prajakta <<a href="mailto:praj.jagtap@gmail.com" class="">praj.jagtap@gmail.com</a>> wrote:<div><blockquote type="cite" class=""><div class=""><div dir="ltr" class="">Is there a way by which we can get actual number of bytes of data allocated by JEMALLOC + number of bytes allocated by mmap / bro system call in jemalloc?<div class=""><br class=""></div><div class="">I am looking for counters similar to mallinfo counters in jemalloc.</div><div class="">Using mall info() we get information about memory allocations performed using malloc.</div><div class=""><br class=""></div><div class="">I need similar counters from jemalloc:</div><div class="">- <b class="">hblkhd</b>: Number of bytes in blocks currently allocated using mmap(2)</div><div class="">- <b class="">uordblks</b>: Total number of bytes usd by in-use allocations </div><div class="">- <b class="">fordblks</b>: Total number of bytes in free blocks.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Out of above 3, I suspect, stats.allocated is similar to uordblks.</div></div></div></blockquote></div><br class=""><div class="">Unfortunately, mallinfo()'s API has some implementation detail baked in, and it doesn't map perfectly to jemalloc. Nonetheless, jemalloc does provide similar, more detailed stats.</div><div class=""><br class=""></div><div class="">hblkhd: Under typical operating conditions, jemalloc allocates *all* memory via mmap(), so this stat isn't generally useful. That said, <a href="http://www.canonware.com/download/jemalloc/jemalloc-latest/doc/jemalloc.html#stats.arenas.i.large.allocated" class="">http://www.canonware.com/download/jemalloc/jemalloc-latest/doc/jemalloc.html#stats.arenas.i.large.allocated</a> and <a href="http://www.canonware.com/download/jemalloc/jemalloc-latest/doc/jemalloc.html#stats.arenas.i.huge.allocated" class="">http://www.canonware.com/download/jemalloc/jemalloc-latest/doc/jemalloc.html#stats.arenas.i.huge.allocated</a> may be of interest depending on your use case.</div><div class="">uordblks: Precisely the same as <a href="http://www.canonware.com/download/jemalloc/jemalloc-latest/doc/jemalloc.html#stats.allocated" class="">http://www.canonware.com/download/jemalloc/jemalloc-latest/doc/jemalloc.html#stats.allocated</a> .</div><div class="">fordblks: Use <a href="http://www.canonware.com/download/jemalloc/jemalloc-latest/doc/jemalloc.html#stats.resident" class="">http://www.canonware.com/download/jemalloc/jemalloc-latest/doc/jemalloc.html#stats.resident</a> or <a href="http://www.canonware.com/download/jemalloc/jemalloc-latest/doc/jemalloc.html#stats.mapped" class="">http://www.canonware.com/download/jemalloc/jemalloc-latest/doc/jemalloc.html#stats.mapped</a> and subtract out <a href="http://www.canonware.com/download/jemalloc/jemalloc-latest/doc/jemalloc.html#stats.active" class="">http://www.canonware.com/download/jemalloc/jemalloc-latest/doc/jemalloc.html#stats.active</a> .</div><div class=""><br class=""></div><div class="">Jason</div></body></html>