java GC optimization, G1GC
2013-11-06 11:12
337 查看
引用 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"
-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"
相关文章推荐
- 关于java中的Math.round(para)函数
- javascrip与C#高级语言的程序设计
- eclipse部署ExtJS卡
- java字节码修改
- 简易版基于Java的处理静态资源服务器实现
- java checkstyle检查问题
- Caught exception while loading file struts-default.xml 错误
- JavaSE基础学习笔记-接口和多态
- Java 7 新功能: 省略finally, 保证资源正常关闭
- 处理Map、非javabean式的复合类等CXF无法自动转化的类型 (3)
- spring3.0自定义servlet请求生成图片
- java中byte数组与int,long,short,float,char之间的转换
- Android Eclipse集成NDK
- Java对象池技术的原理及其实现
- Struts2防止表单重复提交
- Eclipse SVN插件比较 Subclipse vs Subversive
- 关于java类的封装性的一点看法
- Java HashMap的死循环
- 详解java中抽象类和接口的区别
- java学习——mina篇