查看gc的次数 1,查找出程序进程id # 这里输出tomcat的进程id echo `ps -ef|grep tomcat|grep -v 'grep'|awk '{print $2'}` 2,查看gc的次数 jstat -gc pid