星期四, 9月 26, 2013

[Shell] 監控JVM使用狀態

為了測試目前記憶體佔用的狀態所寫的shell。


cosa-memory.sh


#!/bin/sh

#author: ken tsai
#date: 2013/7/11

TOMCAT_PID=$(ps aux | grep /bin/java |grep -v grep | grep 'logging' |awk '{print $2}') 

echo "tomcat pid :$TOMCAT_PID"
echo "######################memory monitor##################"
jstat -gcutil -h 10 $TOMCAT_PID 1000

-gcutil Option


Summary of Garbage Collection Statistics
列名描述
S0survivor 0区利用率。
Survivor space 0 utilization as a percentage of
the space’s current capacity.
S1survivor 1区利用率。
Survivor space 1 utilization as a percentage of
the space’s current capacity.
Eeden区利用率。
Eden space utilization as a percentage of
the space’s current capacity.
O年老代空间利用率。
Old space utilization as a percentage of
the space’s current capacity.
P永生代空间利用率。Permanent space utilization as a percentage of
the space’s current capacity.
YGCyoung gc次数。
Number of young generation GC events.
YGCTyoung gc耗时。
Young generation garbage collection time.
FGCfull gc次数。
Number of full GC events.
FGCTfull gc耗时。
Full garbage collection time.
GCTGC总耗时。
Total garbage collection time.
參考資料
http://itzoo.info/?p=256

1 則留言:

留個話吧:)

其他你感興趣的文章

Related Posts with Thumbnails