部分JVM参数解释
2016-03-08 10:34
369 查看
从大神手里拿过来的JVM调优参数,仅仅是把每个参数的含义查询了一下,越是查询越是感觉得到,小用户量的产品优化无从谈起,用户量起来了一切就要从细节入手慢慢优化。知识还需要继续深化,自己知道的往往是浮在表面的东西。
堆=年轻代(new)+年老代(old)
年轻代 = Eden 和 Survivor*2
-Xmx2048m 最大堆大小
-Xms2048m 初始堆大小
-Xmn1024m 年轻代大小
-Xss1m 每个线程的堆栈大小
-XX:PermSize=256m 初始持久代大小
-XX:MaxPermSize=256m 最大持久代大小
-XX:+UseParNewGC 设置年轻代为并行收集
-XX:+UseConcMarkSweepGC 设置年老代为并发收集
-XX:+CMSParallelRemarkEnabled 降低标记停顿
-XX:SurvivorRatio=8 eden/survivor的比值
-XX:MaxTenuringThreshold=15 这个参数用于控制对象能经历多少次Minor GC才晋升到旧生代
-XX:CMSInitiatingOccupancyFraction=75 CMS堆上, 使用75%后开始CMS收集。
-XX:+UseCMSInitiatingOccupancyOnly 仅仅使用手动定义初始化定义开始CMS收集
-XX:+UseCompressedOops
Most HotSpot JVM in the last year have had it on by default. This option allows references to be 32-bit in a 64-bit JVM and access close to 32 GB of heap. (more than 32-bit pointers can) (You can have near unlimited off heap memory as well). This can save a significant amount of memory and potentially improve performance.
If you want to use this option I suggest you update to a version which has it on by default as there may have been a good reason, such as bugs, why it wasn't enabled previously. Try Java 6 update 23 or Java 7 update 5.
In short, don't turn it on, use a version which has it on by default.
-XX:+PrintGCDetails 打印较为详细的GC信息
-XX:+PrintGCDateStamps 打印GC时间戳,相对于应用程序启动的时间
-XX:+PrintClassHistogram 打印类的直方图 ,用kill -3 pid 会打印
-Xloggc:log/gc.log 打印GC信息到指定文件 可以设置绝对路径的。
堆=年轻代(new)+年老代(old)
年轻代 = Eden 和 Survivor*2
-Xmx2048m 最大堆大小
-Xms2048m 初始堆大小
-Xmn1024m 年轻代大小
-Xss1m 每个线程的堆栈大小
-XX:PermSize=256m 初始持久代大小
-XX:MaxPermSize=256m 最大持久代大小
-XX:+UseParNewGC 设置年轻代为并行收集
-XX:+UseConcMarkSweepGC 设置年老代为并发收集
-XX:+CMSParallelRemarkEnabled 降低标记停顿
-XX:SurvivorRatio=8 eden/survivor的比值
-XX:MaxTenuringThreshold=15 这个参数用于控制对象能经历多少次Minor GC才晋升到旧生代
-XX:CMSInitiatingOccupancyFraction=75 CMS堆上, 使用75%后开始CMS收集。
-XX:+UseCMSInitiatingOccupancyOnly 仅仅使用手动定义初始化定义开始CMS收集
-XX:+UseCompressedOops
Most HotSpot JVM in the last year have had it on by default. This option allows references to be 32-bit in a 64-bit JVM and access close to 32 GB of heap. (more than 32-bit pointers can) (You can have near unlimited off heap memory as well). This can save a significant amount of memory and potentially improve performance.
If you want to use this option I suggest you update to a version which has it on by default as there may have been a good reason, such as bugs, why it wasn't enabled previously. Try Java 6 update 23 or Java 7 update 5.
In short, don't turn it on, use a version which has it on by default.
-XX:+PrintGCDetails 打印较为详细的GC信息
-XX:+PrintGCDateStamps 打印GC时间戳,相对于应用程序启动的时间
-XX:+PrintClassHistogram 打印类的直方图 ,用kill -3 pid 会打印
-Xloggc:log/gc.log 打印GC信息到指定文件 可以设置绝对路径的。
相关文章推荐
- Docker简明教程
- Intent获取Activity返回值
- sed 一些用法
- 1410501134
- hdu2852KiKi's K-Number【线段树第k小】
- Linux三剑客之grep伐木累(正则表达式)
- Android Context上下文(几种的对比,应用场景)
- struts2 动态方法调用
- iOS AFN 封装POST网络请求(AFURLSessionManager)
- SVN - 主干/分支
- Cocos2d-x Android修改ICON名字、更改图标、修改屏幕方向、修改版本号
- Photoshop问题:保存图片时出现“无法完成请求,因为程序错误”
- 下载网络文件HttpURLConnection.getContentLength()大小为 -1
- GPU视频编解码及性能质量测试基础
- 稀疏——字典学习
- C#.Net前台线程与后台线程的区别
- Error inflating class android.support.v7.widget.Toolbar
- Unity 中关于 BuildSetting 中 “Optimize Mesh Data” 选项的“坑”
- k均值聚类
- Android Fragment的基本介绍和使用(收集起来便于回顾)