• Java 优化要点


    java优化四个要素:1、-server服务器方式启动2、-Xms1g -Xmx1g初始大小与最大大小保持一致 -Xss256k线程栈从默认128扩到256  3、-Xmn512m新生代内存:年老代内存保持 1:2到1:1左右 4、回收器选择,暂定cms的回收器UseConcMarkSweepGC

    JAVA_OPTS="-server  -Xms1g -Xmx1g -Xmn512m -Xss256k -XX:PermSize=256M -XX:MaxPermSize=512M -XX:SurvivorRatio=8 -XX:MaxTenuringThreshold=5 -XX:GCTimeRatio=19 -Xnoclassgc -XX:+DisableExplicitGC -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+UseCMSCompactAtFullCollection -XX:CMSFullGCsBeforeCompaction=0 -XX:-CMSParallelRemarkEnabled -XX:CMSInitiatingOccupancyFraction=70 -XX:SoftRefLRUPolicyMSPerMB=0 -XX:+PrintClassHistogram -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintHeapAtGC -Xloggc:/data/log/applogs/gc.log";

    另外一个优化:

    JAVA_OPTS="-Xms2g -Xmx2g -Xmn512m -XX:MaxPermSize=256m  -server -Xss256k -XX:PermSize=128M -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:/data/log/gclog/gc.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/data/log/jvmdump/jvm.bin -XX:+UseConcMarkSweepGC -XX:+UseParNewGC  -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+UseCMSCompactAtFullCollection -XX:CMSFullGCsBeforeCompaction=0 -XX:+CMSClassUnloadingEnabled -XX:+TieredCompilation  -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationStoppedTime -XX:+PrintHeapAtGC

    并嘱咐了一句loggc和dumpPath提前mkdir

  • 相关阅读:
    ES6--Promise讲解
    JavaScript原型链以及Object,Function之间的关系
    webpack中利用require.ensure()实现按需加载
    js中cssText批量修改元素样式
    js判断数组中是否有重复元素
    vue生命周期小总结
    学习vue生命周期
    [异步请求]ajax、axios、fetch之间的详细区别以及优缺点
    [Es6]原生Promise的使用方法
    [javascript]原生js实现Ajax
  • 原文地址:https://www.cnblogs.com/tonyauto/p/10280727.html
Copyright © 2020-2023  润新知