1. jetty9版本modules目录下jvm.mod来优化jetty-web容器.
java -jar ..jetty-distribution-9.2.5.v20141112start.jar --add-to-start=jvm
2.查看目录下的start.ini文件
cat ..jetty-distribution-9.2.5.v20141112start.ini
3.将start.ini配置复制jetty-web容器下的start.ini
GNU nano 2.7.4 File: start.ini # ---------------------------------------
--module=jvm ## JVM Configuration ## If JVM args are include in an ini file then --exec is needed ## to start a new JVM from start.jar with the extra args. ## ## If you wish to avoid an extra JVM running, place JVM args ## on the normal command line and do not use --exec --exec -Xmx512m -Xms512m #G1垃圾回收器建议不要指定Xmn的大小 #-Xmn768m -Xss256k -XX:+UseG1GC -XX:MaxGCPauseMillis=200 #-XX:+UseConcMarkSweepGC #-XX:ParallelCMSThreads=2 #-XX:+CMSClassUnloadingEnabled #-XX:+UseCMSCompactAtFullCollection #-XX:CMSInitiatingOccupancyFraction=80 #-internal:gc -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+PrintGCDetails -XX:+PrintTenuringDistribution -XX:+PrintCommandLineFlags -XX:+DisableExplicitGC -verbose:gc -Xloggc:/var/log/jvm/iauth7003/heap_trace.txt -XX:+HeapDumpOnOutOfMemoryError #设置堆外内存,以便锁定每个应用所使用的内存大小 -XX:MaxDirectMemorySize=64m #-XX:SurvivorRatio=4