Comment 2 for bug 1099774

Is it normal not to find libjemalloc after installing latest Percona Server 5.6.27 from source?

As per documentation path to libjemalloc.so must be specified:

https://github.com/percona/tokudb-percona-server-5.6/wiki/Run-mysqld-with-jemalloc
https://www.percona.com/doc/percona-server/5.6/tokudb/tokudb_installation.html#libjemalloc-library

CMAKE command:

cmake -DCMAKE_INSTALL_PREFIX=/opt/percona-5.6.27 -DMYSQL_DATADIR=/opt/percona-5.6.27/datadir -DSYSCONFDIR=/opt/ -DWITH_SSL=system -DMYSQL_TCP_PORT=3307 -DMYSQL_UNIX_ADDR=/opt/percona-5.6.27/mysqld.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_DEBUG=1 -DCOMPILATION_COMMENT="Shahriyar Rzayev's Percona Server" -DOPTIMIZER_TRACE=1 -DWITH_ZLIB=system -DWITH_VALGRIND=1 -DCMAKE_C_FLAGS=-DHAVE_purify -DCMAKE_CXX_FLAGS=-DHAVE_purify -DENABLE_DOWNLOADS=1

make
make install

No result:

[root@testing-host1 ~]# locate jemalloc
[root@testing-host1 ~]# locate libjemalloc
[root@testing-host1 ~]# ls /usr/local/ | grep jemalloc
[root@testing-host1 ~]# ls /usr/local/ | grep libjemalloc
[root@testing-host1 ~]# ls /usr/local/ | grep malloc

Again no result:

[root@testing-host1 ~]# ls /opt/percona-5.6.27/lib/
libHotBackup.so libmysqlservices.a libperconaserverclient_r.a libperconaserverclient_r.so.18 libperconaserverclient.so libperconaserverclient.so.18.1.0
libmysqld.a libperconaserverclient.a libperconaserverclient_r.so libperconaserverclient_r.so.18.1.0 libperconaserverclient.so.18 mysql
[root@testing-host1 ~]# ls /opt/percona-5.6.27/lib/ | grep malloc
[root@testing-host1 ~]# ls /opt/percona-5.6.27/lib/mysql/ | grep malloc

It is also obvious that jemalloc is not shipped with official .tar.gz:

[root@testing-host1 ~]# tar -ztvf Percona-Server-5.6.27-rel75.0-Linux.x86_64.ssl101.tar.gz | grep jemalloc
[root@testing-host1 ~]# tar -ztvf Percona-Server-5.6.27-rel75.0-Linux.x86_64.ssl101.tar.gz | grep malloc
-rw-r--r-- root/root 1506 2015-11-03 15:14 Percona-Server-5.6.27-rel75.0-Linux.x86_64.ssl101/mysql-test/suite/innodb/r/innodb-use-sys-malloc.result
-rw-r--r-- root/root 56 2015-11-03 15:14 Percona-Server-5.6.27-rel75.0-Linux.x86_64.ssl101/mysql-test/suite/innodb/t/innodb-use-sys-malloc-master.opt
-rw-r--r-- root/root 1560 2015-11-03 15:14 Percona-Server-5.6.27-rel75.0-Linux.x86_64.ssl101/mysql-test/suite/innodb/t/innodb-use-sys-malloc.test
-rw-r--r-- root/root 1017 2015-11-03 15:14 Percona-Server-5.6.27-rel75.0-Linux.x86_64.ssl101/mysql-test/suite/sys_vars/r/innodb_use_sys_malloc_basic.result
-rw-r--r-- root/root 796 2015-11-03 15:14 Percona-Server-5.6.27-rel75.0-Linux.x86_64.ssl101/mysql-test/suite/sys_vars/t/innodb_use_sys_malloc_basic.test

Another thing to mention about Ubuntu percona-server-tokudb-5.6 package. It has libjemalloc1 dependency which is installing as separate package:

sudo apt-get install percona-server-tokudb-5.6
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
 libjemalloc1
The following NEW packages will be installed:
 libjemalloc1 percona-server-tokudb-5.6

So the result is with binary version jemalloc installed as dependency. There is no jemalloc lib in installation directory if it is installed from source. Inside generic red hat 7 linux .tar.gz archive can not find linked library.