tcmalloc安装与使用

来源:互联网 发布:linux sys.h 编辑:程序博客网 时间:2024/05/21 22:36

1、git clone https://github.com/junlon2006/gperftools

2、./autogen.sh

3、./configure

4、make; make install

5、 echo "/usr/local/lib" > /etc/ld.so.conf.d/usr_local_lib.conf

6、/sbin/ldconfig

7、

8、gcc动态连接,加上-ltcmalloc(一定要加在最后)

9、内存检查:

设置pperf的环境变量:export PPROF_PATH=/usr/local/bin/pprof

env HEAPCHECK=normal ./main

10、常见问题:



原创粉丝点击