操作系统:centos7
jdk版本8
yum -y install gcc gcc-c++
wget http://download.savannah.gnu.org/releases/libunwind/libunwind-0.99.tar.gz
wget https://github.com/gperftools/gperftools/releases/download/gperftools-2.6.1/gperftools-2.6.1.tar.gz
./configure --prefix=/usr/local/app/tool/gperftools && make -j && make install
./configure --prefix=/usr/local/app/tool/libunwind && make -j && make install
vim /etc/ld.so.conf.d/usr_local_lib.conf
/usr/local/app/tool/gperftools/lib
/usr/local/app/tool/libunwind/lib
/sbin/ldconfig
export LD_PRELOAD=/usr/local/app/tool/gperftools/lib/libtcmalloc.so
export HEAPPROFILE=/usr/local/app/testapp/hprof
java -jar merciless-0.0.1-SNAPSHOT.jar
tool/gperftools/bin/pprof /bin/ls --text .0001.heap
标签:java,lib,堆外,app,内存,gperftools,local,tool,usr From: https://www.cnblogs.com/merciless/p/18244766