1
0

tcmalloc.sh 829 B

12345678910111213141516171819202122232425262728
  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. # https://oneinstack.com
  9. # https://github.com/lj2007331/oneinstack
  10. Install_tcmalloc() {
  11. pushd ${oneinstack_dir}/src
  12. tar xzf gperftools-$tcmalloc_version.tar.gz
  13. pushd gperftools-$tcmalloc_version
  14. ./configure --enable-frame-pointers
  15. make -j ${THREAD} && make install
  16. popd
  17. if [ -f "/usr/local/lib/libtcmalloc.so" ]; then
  18. echo '/usr/local/lib' > /etc/ld.so.conf.d/local.conf
  19. ldconfig
  20. echo "${CSUCCESS}tcmalloc module installed successfully! ${CEND}"
  21. rm -rf gperftools-$tcmalloc_version
  22. else
  23. echo "${CFAILURE}tcmalloc module install failed, Please contact the author! ${CEND}"
  24. kill -9 $$
  25. fi
  26. popd
  27. }