資料庫記憶體管理:tcmalloc與jemalloc
阿新 • • 發佈:2019-01-03
[[email protected] ~]# tar zxvf libunwind-1.2.1.tar.gz [[email protected] ~]# cd libunwind-1.2.1 [[email protected] libunwind-1.2.1]# ./configure [[email protected] libunwind-1.2.1]# make && make install [[email protected] ~]# tar zxvf gperftools-2.7.tar.gz [[email protected] ~]# cd gperftools-2.7 [[email protected] google-perftools-2.7]# ./configure [[email protected] google-perftools-2.7]# make && make install [[email protected] ~]# vi /usr/local/mysql/bin/mysqld_safe export LD_PRELOAD=/usr/local/lib/libtcmalloc.so [[email protected] ~]# echo "/usr/local/lib" >> /etc/ld.so.conf [[email protected] ~]# ldconfig [[email protected] ~]# service mysqld restart Shutting down MySQL.. [ OK ] Starting MySQL.. [ OK ] [[email protected] ~]# lsof -n | grep tcmalloc mysqld 30576 mysql mem REG 8,3 2312499 4092713 /usr/local/lib/libtcmalloc.so.4.5.3