Hello,<br><br>I am using jemalloc for my server application and I have been monitoring the memory (rss) for several days and it continues to rise.  I have previously monitored the application using valgrind for several days and it reported no memory leaks.<br>
<br>This leads me to believe that the rise in memory consumption (rss) is due to memory fragmentation.<br><br>With this in mind, I added to my application the call to <code class="function">malloc_stats_print</code>(<em class="parameter"><code></code></em>) function and I poll this function every hour and save the results.  From what I see and understand from this report, I do indeed see the memory consumption rising and I also noticed that the number of bigger allocations increases (~2.5 MB) over time.<br>
<br>I have been reading quite a bit about jemalloc, and what I fail to understand how to do yet is how to use this report to support the notion that my application is actually experiencing memory fragmentation.<br><br>So my questions are:<br>
<br><ol><li>How can I use the <code class="function">malloc_stats_print</code>(<em class="parameter"><code></code></em>) stats to show that my application is suffering from memory fragmentation?</li><li>Is there a way to help eliminate fragmentation in jemalloc, perhaps by calling an extended facility?<br>
</li><li>Will using thread cache flushing and forced dirty page purging help reduce fragmentation? Is it a good idea?</li></ol><p>Thanks a lot for the help and have a great day,</p><p>Benjamin</p><p><br></p><p><br></p>