linux系统 64位下编译安装tcmalloc

  1. 下载安装libunwind
  •  tar -xvf libunwind-0.99-alpha.tar.gz   //解压
  • cd libunwind-0.99-alpha/                      //进到目录下
  • CFLAGS=-fPIC ./configure                   //配置
  • make CFLAGS=-fPIC                           //编译
  • make CFLAGS=-fPIC install                 //安装

下载地址:http://download.savannah.gnu.org/releases/libunwind/libunwind-0.99-alpha.tar.gz

   2. 下载安装google-perftools

  • tar -xvf google-perftools-2.5.tar.gz
  • cd google-perftools-2.5/
  • ./configure
  • make && make install

下载地址:https://github.com/gperftools/gperftools/releases/download/gperftools-2.5/gperftools-2.5.tar.gz

  3. 配置

->echo "/usr/local/lib" > /etc/ld.so.conf.d/usr_local_lib.conf               //添加"/usr/local/lib"到usr_local_lib.conf 文件中

->/sbin/ldconfig                                                                                  // 使libunwind生效

export LD_PRELOAD=/usr/local/lib/libtcmalloc.so
export HEAPPROFILE=/usr/local/gzip

猜你喜欢

转载自blog.csdn.net/heguangsui123/article/details/89213164