<div dir="ltr">I will upgrade to dev version of jemalloc. Thanks for the quick input. </div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 20, 2015 at 10:31 PM, Jason Evans <span dir="ltr"><<a href="mailto:jasone@canonware.com" target="_blank">jasone@canonware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Jan 20, 2015, at 5:17 AM, SNL <<a href="mailto:snl20465@gmail.com">snl20465@gmail.com</a>> wrote:<br>
> Here is what I am doing currently:<br>
><br>
> 1. I am trying to carve out 10 MB memory area at the higher end of process address space using mmap (MAP_FIXED..).<br>
><br>
> 2. I created a new arena using arenas.extend mallctl<br>
><br>
> 3. I am using mallocx/dallocx with MALLOCX_ARENA(arena) as documented.<br>
><br>
> The issue is how do I connect the arena to mmaped memory chunk ? I see that new arena never gets initialized and all allocations continue to happen from arena 0x0.<br>
> I thought thread.arena mallctl will connect the arena to mmapped chunk but it just creates a thread <-> arena mapping.<br>
><br>
> I looked at the sources to see if there is any other mallctl to create this association but there does not seem to be any, what am I missing here ?<br>
><br>
> And older sample program I found on this mailing list, uses following mallctl which is not supported in jemalloc 3.6.<br>
><br>
><br>
> snprintf(path, sizeof(path), "arena.%u.chunk.alloc", _arena);<br>
>   ret = __svm_mallctl(path, (void*)&_chunk_alloc, &sz, (void*)&_chunk_alloc, sizeof(void *));<br>
>   assert (ret == 0);<br>
><br>
> snprintf(path, sizeof(path), "arena.%u.chunk.dalloc", _arena);<br>
>   ret = __svm_mallctl(path, (void*)&_chunk_dalloc, &sz, (void*)&_chunk_dalloc, sizeof(void *));<br>
>   assert (ret == 0);<br>
><br>
><br>
> This basically is asking jemalloc to callback user defined functions, is this functionality still available in jemalloc ? Any inputs will be helpful. Thanks.<br>
<br>
</div></div>The features you're trying to use only exist in the dev version of jemalloc so far ("arena.<i>.chunk.alloc" and "arena.<i>.chunk.dalloc" mallctl interfaces).  Note that related control over dirty page purging still needs to be implemented (<a href="https://github.com/jemalloc/jemalloc/issues/93" target="_blank">https://github.com/jemalloc/jemalloc/issues/93</a>).<br>
<span class="HOEnZb"><font color="#888888"><br>
Jason</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><br>Cheers,<br>Sunny. <br></div>
</div>