google-perftools安装

source link:http://blog.sina.com.cn/s/blog_704836f40100yvyx.html

1.编译libunwind

 

因为使用的是X86_64Linux系统,因此需要安装libunwind库。

安装方法很简单,常见的configure,make,make install的套路。

 

wget http://download.savannah.gnu.org/releases/libunwind/libunwind-0.99-beta.tar.gz

tar xvzf libunwind-0.99-beta.tar.gz

cd libunwind-0.99-beta

./configure

make

make install

 

因为默认的libunwind安装在/usr/local/lib目录下,需要将这个目录添加到系统动态库缓存中。

 

echo "/usr/local/lib" > /etc/ld.so.conf.d/usr_local_lib.conf
/sbin/ldconfig

 

libunwind的最新版本是1.0.1,那为什么不选择最新版本呢?google perftoolsINSTALL文件中给了说明。版本低于0.99-betalibunwindpreftools一起工作可能不正常,但是高于0.99-beta的版本中可能包含一些与perftools不兼容的代码(因为libunwind会调用malloc,可能会导致死锁)libunwindX86_64平台上和perftools有不少问题,不过不会影响核心的tcmalloc库,但是会影响perftools中的工具,例如cpu-profiler, heap-checker,heap-profiler。

 

2.编译google-perftools

 

因为我们只需要tcmalloc功能,因此不编译google-perftools中的其他工具。

wget http://gperftools.googlecode.com/files/google-perftools-1.9.1.tar.gz

tar xvzf google-perftools-1.9.1.tar.gz

cd google-perftools-1.9.1

./configure --disable-cpu-profiler --disable-heap-profiler --disable-heap-checker --enable-minimal--disable-dependency-tracking

make

make install

/sbin/ldconfig


一些有关系的文档连接:

http://goog-perftools.sourceforge.net/doc/tcmalloc.html

http://wiki.nginx.org/GooglePerftoolsModule

http://www.centos.bz/2012/01/google-perftools-speed-up-mysql-tcmalloc/

http://blog.ops.tudou.com/wp/?p=96

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值