監控Java的GC狀態
命令:jstat -gcutil $PID(程序ID) $PERIOD(間隔時間,單位毫秒) $TIMES(次數)
示例如下:
[email protected]:/home/test> ps x
PID TTY STAT TIME COMMAND3517 ? Sl 1000:32 /usr/java/jdk1.7.0_40/jre/bin/java -Djava.security.auth.login.config=/home/test/config/local/test.authentication.config -XX:+PrintGCDetails -XX:+HeapDumpOnOutOfMemoryError -Xloggc:/h
5917 pts/2 S 0:00 -ksh
16353 pts/2 R+ 0:00 ps x
S0 S1 E O P YGC YGCT FGC FGCT GCT
1.51 0.00 88.48 57.98 17.29 7340 170.090 2 0.111 170.201
1.51 0.00 90.17 57.98 17.29 7340 170.090 2 0.111 170.201
1.51 0.00 90.22 57.98 17.29 7340 170.090 2 0.111 170.201
1.51 0.00 90.22 57.98 17.29 7340 170.090 2 0.111 170.201
1.51 0.00 90.25 57.98 17.29 7340 170.090 2 0.111 170.201