zoukankan      html  css  js  c++  java
  • java GC optimization, G1GC

    引用    http://www.avricot.com/blog/?post/2010/05/03/Get-started-with-java-JVM-memory-(heap%2C-stack%2C-xss-xms-xmx-xmn...)

      -Xmx : max heap size (ex: -Xmx4g)

      -Xms : min heap size. (ex: -Xms2g) 

      -Xmn : the size of the heap for the young generation
          Young generation represents all the objects which have a short life of time. Young generation objects are in a specific location into the heap, where the garbage collector will pass often.

          All new objects are created into the young generation region (called "eden").

          When an object survive is still "alive" after more than 2-3 gc cleaning, then it will be swap has an "old generation" : they are "survivor" .
          Good size is 33%

    优化之前

      JAVA_OPTS="-Xmn3g -Xms4g -Xmx4g -XX:PermSize=512m -XX:MaxPermSize=512m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000"

    优化之后

      JAVA_OPTS="             -Xms4g -Xmx4g -XX:PermSize=512m -XX:MaxPermSize=512m -XX:+UseG1GC -XX:MaxGCPauseMillis=100 -XX:+ParallelRefProcEnabled -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000"

  • 相关阅读:
    Spinal Tap Case
    Sorted Union
    Search and Replace
    Boo who
    Missing letters
    DNA Pairing
    Pig Latin
    Where art thou
    Roman Numeral Converter
    Redis高级客户端Lettuce详解
  • 原文地址:https://www.cnblogs.com/lpthread/p/3410081.html
Copyright © 2011-2022 走看看