<div dir="ltr"><div><div><div><div>Hi,<br><br></div>I have been trying to use jemalloc for my application and observed that the rss of the process keeps on increasing.<br><br></div>I ran the application with valgrind to confirm that there are no memory leaks.<br>
<br></div>To investigate more, I collected jemalloc stats after running the test for few days and here is the summary for a run with narenas:1, tcache:false, lg_chunk:24<br></div><div><br> Arenas: 1<br> Pointer size: 8<br>
Quantum size: 16<br> Page size: 4096<br> Min active:dirty page ratio per arena: 8:1<br> Maximum thread-cached size class: 32768<br> Chunk size: 16777216 (2^24)<br> Allocated: 24364176040, active: 24578334720, mapped: 66739765248<br>
Current active ceiling: 24578621440<br> chunks: nchunks highchunks curchunks<br> 3989 3978 3978<br> huge: nmalloc ndalloc allocated<br> 3 2 117440512<br> <br>
arenas[0]:<br> assigned threads: 17<br> dss allocation precedence: disabled<br> dirty pages: 5971898:64886 active:dirty, 354265 sweeps, 18261119 madvises, 1180858954 purged<br><br></div><div>While in this state, the RSS of the process was at 54GB.<br>
<br></div><div>Questions:<br></div><div>1) The difference between RSS and jemalloc active is huge (more than 30GB). In my test, the difference was quite less in the beginning (say 4 GB) and it went on increasing with time. That seems too high to account for jemalloc data structures, overhead etc. What else gets accounted in process RSS - active?<br>
</div><div>2) The allocations are fairly random, sized between 8 bytes and 2MB. Are there any known issues of fragmentation for particular allocation sizes?<br></div><div>3) Is there a way to tune the allocations and reduce the difference? <br>
</div><div><br></div><div>Will appreciate any help to understand this better,<br><br></div><div>Thanks,<br></div><div>Vandana<br></div></div>