码迷,mamicode.com
首页 > 其他好文 > 详细

jvm优化

时间:2016-05-12 17:31:52      阅读:183      评论:0      收藏:0      [点我收藏+]

标签:

一、用JMeter创建100个线程对指定url进行压力测试。初始状态,吞吐量为8.7/s

技术分享

技术分享

二、参考java程序性能优化,在tomcat的catalina.bat新增配置。重新设置堆大小和永久区大小、禁用显示GC、去掉类校验、使用并行回收收集器代替串行收集器、使用CMS回收器、设置较大的survivior区,努力将对象预留在新生代、将CMS的Full GC触发的阈值设置为78%,即当老年代使用到78%时,才触发Full GC。吞吐率提高到9.4/s

set CATALINA_OPTS=%CATALINA_OPTS% "-XX:+PrintGCDetails"
set CATALINA_OPTS=%CATALINA_OPTS% "-Xmx512M"
set CATALINA_OPTS=%CATALINA_OPTS% "-Xms512M"
set CATALINA_OPTS=%CATALINA_OPTS% "-XX:PermSize=64M"
set CATALINA_OPTS=%CATALINA_OPTS% "-XX:MaxPermSize=64M"
set CATALINA_OPTS=%CATALINA_OPTS% "-XX:+DisableExplicitGC"
set CATALINA_OPTS=%CATALINA_OPTS% "-Xverify:none"
set CATALINA_OPTS=%CATALINA_OPTS% "-XX:+UseConcMarkSweepGC"
set CATALINA_OPTS=%CATALINA_OPTS% "-XX:ParallelCMSThreads=8"
set CATALINA_OPTS=%CATALINA_OPTS% -XX:+UseCMSCompactAtFullCollection
set CATALINA_OPTS=%CATALINA_OPTS% -XX:CMSFullGCsBeforeCompaction=0
set CATALINA_OPTS=%CATALINA_OPTS% -XX:CMSInitiatingOccupancyFraction=78
set CATALINA_OPTS=%CATALINA_OPTS% -XX:SoftRefLRUPolicyMSPerMB=0
set CATALINA_OPTS=%CATALINA_OPTS% -XX:+CMSParallelRemarkEnabled
set CATALINA_OPTS=%CATALINA_OPTS% -XX:SurvivorRatio=1
set CATALINA_OPTS=%CATALINA_OPTS% -XX:+UseParNewGC

技术分享

技术分享



jvm优化

标签:

原文地址:http://blog.csdn.net/bobchao0730/article/details/51362583

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!