<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 Mar 24, 2015, at 6:53 AM, SNL <<a href="mailto:snl20465@gmail.com" class="">snl20465@gmail.com</a>> wrote:<div><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="">If this is not possible ( I see an old post which says jemalloc does not have this infra but that was back in 2012 ). Is it possible to iterate over just an arena and dump all allocations in it  ? Basically, I have memory pool implemented on top of jemalloc which holds metadata about all other allocations jemalloc does, if I can iterate over this arena and get hold of metadata, I can get hold of each allocation as well. </div><div class=""><br class=""></div><div class="">Any thoughts would be appreciated. </div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Tue, Mar 24, 2015 at 5:28 PM, SNL <span dir="ltr" class=""><<a href="mailto:snl20465@gmail.com" target="_blank" class="">snl20465@gmail.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class=""><div class=""><br class=""></div>My use case is to walk through all live allocations ( the ones which are not freed yet) of all sizes the program ever made and dump it as the end of the program or on demand. I have looked at stats but I want something with even more details. Basically, the function should be able to iterate through all arenas and print details on following lines:<div class=""><br class=""></div><div class="">arena = 1 base = 0x7fd7beb88800 size = 15 bytes etc<br clear="all" class=""><div class=""><br class=""></div><div class="">Is there any api in jemalloc which already does subset of this  ? Any pointers will be helpful. </div></div></div></blockquote></div></div></div></div></blockquote></div><br class=""><div class="">jemalloc doesn't support iteration over live allocations, and it's unlikely to ever directly support iteration, because the feature imposes nontrivial additional complexity for limited benefit.  The closest thing under consideration is <a href="https://github.com/jemalloc/jemalloc/issues/203" class="">https://github.com/jemalloc/jemalloc/issues/203</a>, but I don't plan to work on that until at least next year.</div><div class=""><br class=""></div><div class="">Does your use case allow you to wrap the allocator and keep a side table which supports iteration, or can you trace allocation activity and post-process it?</div><div class=""><br class=""></div><div class="">Jason</div></body></html>