Hi, <br>Recently I've met a profiling challenge that has something to do with jemalloc:<br>There are two threads, one of which runs the following index() function while the other runs search() below. Within each thread, memory allocation is frequently called especially within the index() function. Although there does not exist any race condition between the two threads, I could see that the performance of search() has been seriously affected---maybe downgraded to tens of times than the situation no index thread is running. From some profiling tools could I conclude that the performance downgrading has something to do with the memory allocation. Suppose within search(), over 2k malloc/free is called, and the overall time could be lowered from 3ms to 0.4s if index thread is started, but search() will never be affected if it runs within a forked process instead of thread. <br>
<br>void index()<br>{<br>}<br><div><br>void search()<br>{<br>}</div><br><br>I believe it has something to do with the parameter tuning for jemalloc, could anybody help me in figuring out such configuration? <br>Very grateful!<br clear="all">
<br>-- <br>Best Regards<br>Yingfeng<br>