jvm-內存泄露排查步驟總結

1.待定

 

dump腳本

#!/bin/bash



time=`date +%Y%m%d%H%M`
dump_path=/home/ewei/dump
save_path=/home/ewei/dump/${time}-`hostname`
dump_oss_path="/home/ewei/oss/ewei-testenv/dump_file_prod"

if [ ! -d "$save_path" ]; then
    mkdir -p $save_path
fi

dockerid=`docker ps -a -q`

for d_id in ${dockerid[*]}
do
    docker exec -it $d_id jstat -gc 1 > $save_path/fullgc-before.txt
    docker exec -it $d_id jmap -dump:format=b,file=$save_path/before-oom-dump.hprof  1 
    docker exec -it $d_id jmap -histo:live 1 > $save_path/histo.txt
    docker exec -it $d_id jstat -gc 1 > $save_path/fullgc-after.txt
    docker exec -it $d_id jmap -dump:format=b,file=$save_path/after-oom-dump.hprof  1
done

cd $dump_path
tar -zcf ${time}-`hostname`.tar.gz ${time}-`hostname`
mv ${time}-`hostname`.tar.gz $dump_oss_path 
rm ${time}-`hostname` -rf

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章