java 堆外記憶體排查

Me无情發表於2024-06-12

作業系統: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

相關文章