监控java虚拟机

 

jstat -gcutil `ps -ef|grep java|awk '{print $2}'` 1000

jstat -gccapacity `ps -ef|grep java|awk '{print $2}'` 1000

 

jmap -histo `ps -ef|grep java|awk '{print $2}'` 1000

jmap -dump:format=b,file=java_dump `ps -ef|grep java|awk '{print $2}'` 1000

 

 

 

java -Xms30m -Xmx30m -Xmn10m -XX:+UseParallelGC -verbose:gc -XX:+PrintGCDetails -XX:+Print

GCTimeStamps -Xloggc:gc.log -XX:+PrintHeapAtGC  SummaryCase

jstat : jstat -gcutil `ps aux|grep Summ|awk '{ print $2 }'` 1000 10



线上配置:
-server -Xms4g -Xmx4g -Xmn2560m -XX:SurvivorRatio=10 -XX:+UseConcMarkSweepGC -XX:+UseCMSCompactAtFullCollection -XX:CMSMaxAbortablePrecleanTime=5000 -XX:+CMSClassUnloadingEnabled -XX:CMSInitiatingOccupancyFraction=80 -XX:PermSize=96m -XX:MaxPermSize=256m -XX:+UseCompressedOops


google perm tools
export LD_PRELOAD=/usr/local/lib/libtcmalloc.so
env HEAPPROFILE=oomcase.hprof java -Xmn10m -Xms1536m -Xmx1536m NativeMemoryOOMCase



你可能感兴趣的:(java,oracle,linux,虚拟机,cms)