天天看點

jemalloc 使用

cd /opt
wget https://github.com/jemalloc/jemalloc/archive/refs/tags/5.2.1.tar.gz

tar -zxvf 5.2.1.tar.gz
mv jemalloc-5.2.1 jemalloc
cd jemalloc
yum -y install autoconf
./autogen.sh

./configure --enable-debug --enable-prof

make
make install

echo '/usr/local/lib' > /etc/ld.so.conf.d/malloc.conf
ldconfig      
ln: failed to create symbolic link ‘lib/libjemalloc.so’: Operation not supported      
JEMALLOC_PATH=/usr/local
PATH=${JEMALLOC_PATH}/bin:${PATH}
MALLOC_CONF=prof_leak:true,lg_prof_sample:0,prof_final:true \
LD_PRELOAD=${JEMALLOC_PATH}/lib/libjemalloc.so.2 w      
jeprof --show_bytes `which w` jeprof.24803.0.f.heap      
jeprof --show_bytes --pdf `which w` jeprof.24803.0.f.heap > w.pdf

#report error
sh: dot: command not found
sh: ps2pdf: command not found

#install graphviz、ghostscript resovle
yum -y install ghostscript
yum -y install graphviz      

繼續閱讀