java程序启动时设置打印gc log及一些常见jvm参数

java程序启动时怎么设置打印gc log

-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/home/work/log/dump -verbose:gc -Xloggc:gc.log -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCApplicationStoppedTime -XX:+PrintReferenceGC -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false

一些常用的jvm参数设置

 -Xms1024m -Xmx1024m -Xmn256M -XX:MaxDirectMemorySize=128M -XX:MaxPermSize=128M
            -XX:+UseConcMarkSweepGC -Xss512K -XX:+UseParNewGC -XX:+UseCompressedOops -XX:+PrintReferenceGC
            -XX:CMSInitiatingOccupancyFraction=70
发布了35 篇原创文章 · 获赞 81 · 访问量 3万+

猜你喜欢

转载自blog.csdn.net/chanllenge/article/details/90297690