linux Java 手动GC 手动回收垃圾
logs_paths[0]="xxxx_tomcat8_9001";
logs_paths[1]="xxxx_tomcat8_9002";
for logs_path in ${logs_paths[@]}
do
echo "执行GC回收 $logs_path"
tomcatid=$(ps -ef|grep tomcat/$logs_path |grep -v grep|cut -c 9-15)
if [ "$tomcatid" != "" ];
then
jcmd $tomcatid
fi
done