tcmalloc安装

环境是centos 6 (64位)

yum list libunwind-devel  (epel 源)

wget https://gperftools.googlecode.com/files/gperftools-2.1.tar.gz

tar xzf gperftools-2.1.tar.gz

./configure

make

make install

ldconfig

ldconfig -v|grep tcmall

有就说明安装成功了。

然后再编译一个nginx,内存分配用tcmall 

tar xzf nginx-1.4.4.tar.gz

cd nginx-1.4.4

./configure --with-google_perftools_module

make ;make install

vim /usr/local/nginx/conf/nginx.conf

在里面调用

google_perftools_profiles /tmp/tcmalloc;

指定文件名,之后的pid 会附在 /tmp/tcmalloc.<worker_pid>

那这个文件有什么用呢? 待续。。

原文地址:https://www.cnblogs.com/gqdw/p/3534954.html