A Memory Allocator interface is in charge to request and release chunks of memory needed by a program. Most of programs uses the solution provided by the standard LibC but this last one face many fragmentation and performance problems when used on a multithread server as this.
Starting from Monkey v1.4, we have integrated the Jemalloc as the default memory allocator, this is a huge step forward in performance that is visible in multi core systems under a high load.
When building Monkey through the configure script, there is one step that may take a few seconds or minutes depending of the CPU speed due to Jemalloc prepare it builds too. When compiling through the make command the build process will take longer as the dependency library is being built. Note that Jemalloc is linked statically on Monkey binary, that means that Monkey binary size will grow to around 2MB instead of 85KB.
Even Jemalloc is our new and default memory allocator, it continue being an optional feature as there is some cases where users would prefer to use their default OS memory allocator. For those cases we offer a specific configuration mode called --malloc-libc, it can be enabled with:
$ ./configure --malloc-libc
After configure with that option, make sure to perform a clean build of Monkey again:
$ make clean
$ make
You will see that Monkey builds times faster than before and it's binary size is reduced to less than 90KB.
Note: when Jemalloc is enabled you should notice that Monkey uses more memory as reported by top or ps utils, but keep in mind that the only relevant value is the RESident memory (physical memory used) and not the Virtual memory value.