1,安装tcmalloc所需的libunwind库[64位系统需要安装,32位系统无需安装]wget http://download.savannah.gnu.org/releases/libunwind/libunwind-0.99-alpha.tar.gztar zxvf libunwind-0.99-alpha.tar.gz cd libunwind-0.99-alpha/ CFLAGS=-fPIC ./configure make CFLAGS=-fPIC make CFLAGS=-fPIC install 2,安装tcmallocwget http://gperftools.googlecode.com/files/gperftools-2.0.tar.gztar zxvf google-perftools-0.97.tar.gz cd google-perftools-0.97/ ./configure make && make install 默认安装时,libunwind与tcmalloc库均安装至/usr/local/lib 3,配置动态连接库echo "/usr/local/lib" > /etc/ld.so.conf.d/usr_local_lib.conf/sbin/ldconfig 使用:增加编译选项 -ltcmalloc |