Ptmalloc is GLIBC's memory allocation management
Tcmalloc is Google's memory allocation management module
Jemalloc is BSD's provided memory allocation management
The performance of the three Jemalloc and Tcmalloc is not the same, but the Ptmalloc is lower
1. Download
wget http://www.canonware.com/download/jemalloc/jemalloc-4.0.1.tar.bz2
2. Decompression and Installation
TAR-JXVF jemalloc-4.0.1.tar.bz2
CD jemalloc-4.0.1
./configure
Make & make Install
3. Configure MySQL to use Jemalloc
[Mysqld_safe]
Malloc-lib=/usr/local/lib/libjemalloc.so
4. Restart MySQL
Service mysqld Restart
5. See if Jemalloc is in effect
Lsof-n |grep Jemalloc
[Email protected] jemalloc-4.0.1]# lsof-n |grep jemalloc
Mysqld 28837 mysql mem REG 8,3 5894355 25433288/usr/local/lib/libjemalloc.so.2
Displays the above information stating that MySQL has successfully loaded Jemalloc
Jemalloc for MySQL