Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

After reading this blog post about the impact of memory allocators like jemalloc on highly threaded applications, I wanted to test things on a larger scale on some of our cluster of servers. We run sphinx, and apache using threads, and on 24 core machines.

Installing jemalloc was simple enough. We are running Centos 6, so yum install jemalloc jemalloc-devel did the trick. My question is, how do we change everything on the system over to using jemalloc instead of the default malloc built into Centos. Research pointed me at this as a potential option:


Would this be sufficient to get everything using jemalloc?

share|improve this question
I enabled the above and restarted the services that I wanted to rest. In observing, I have seen a decrease in the Reserved memory column as well as quite a bit of movement in that column. Prior to the change the value there was typically static in size. In our case 5.4gb. Now, it fluctuates quite often, and quite quickly, but averages about 4.7gb. Since jemalloc is a faster memory allocator I "think" I can attribute my observation to the fact that it is working. If so, my next question becomes. How can I tell which memory allocator a process is using in linux? – Brian Lovett Mar 9 '13 at 19:12
You can look at /proc/<pid>/maps to see if is mapped. – David Schwartz Jun 30 '14 at 4:38

It's trivial answer (actually I still don't get it how your research could have missed it):


It's documented in — man 8 «…

/etc/ — File containing a whitespace separated list of ELF shared libraries to be loaded before the program.


share|improve this answer

I found the same solution during my research. More detailed with stepwise instructions. There it is also stated that many companies switch to jemalloc (ex. Facebook) or tcmalloc (ex. Github). So you can as well try using tcmalloc (installing is quite similar) or follow the instructions and use jemalloc.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.