tcmalloc.sh 896 B

1234567891011121314151617181920212223242526272829303132
  1. #!/bin/bash
  2. # Author: yeho <lj2007331 AT gmail.com>
  3. # BLOG: https://blog.linuxeye.com
  4. #
  5. # Notes: OneinStack for CentOS/RadHat 5+ Debian 6+ and Ubuntu 12+
  6. #
  7. # Project home page:
  8. # http://oneinstack.com
  9. # https://github.com/lj2007331/oneinstack
  10. Install_tcmalloc()
  11. {
  12. cd $oneinstack_dir/src
  13. src_url=http://mirrors.linuxeye.com/oneinstack/src/gperftools-$tcmalloc_version.tar.gz && Download_src
  14. tar xzf gperftools-$tcmalloc_version.tar.gz
  15. cd gperftools-$tcmalloc_version
  16. ./configure --enable-frame-pointers
  17. make && make install
  18. if [ -f "/usr/local/lib/libtcmalloc.so" ];then
  19. echo '/usr/local/lib' > /etc/ld.so.conf.d/local.conf
  20. ldconfig
  21. echo "${CSUCCESS}tcmalloc module install successfully! ${CEND}"
  22. cd ..
  23. rm -rf gperftools-$tcmalloc_version
  24. else
  25. echo "${CFAILURE}tcmalloc module install failed, Please contact the author! ${CEND}"
  26. kill -9 $$
  27. fi
  28. cd ..
  29. }