Skip to content
This repository has been archived by the owner on Jun 12, 2020. It is now read-only.

Run mysqld with jemalloc

Rik Prohaska edited this page Apr 15, 2015 · 2 revisions

Percona does not statically link jemalloc into mysqld. Percona preloads a jemalloc shared library instead.

Use the system jemalloc

mysqld_safe will look for a jemalloc library in the system library directories and automatically preload it if it is found.

Use a custom jemalloc

mysqld_safe --malloc-lib=PATH_TO_JEMALLOC_LIB/libjemalloc.so

Check if lib/mysql/libjemalloc.so exists in the Percona Server install package. If so, then use it.

If the jemalloc library is not included in the release package, then it is up to the user to build their own jemalloc library. Here is an example of getting jemalloc and building it.

git clone -b 3.6.0 git@github.com:jemalloc/jemalloc jemalloc-3.6.0
cd jemalloc-3.6.0
./autorun.sh
./configure
make