01.JAVA性能调优参考


1.jvm参数

set JAVA_OPTS=-Xms200M -Xmx500M  -XX:PermSize=128M -XX:MaxPermSize=256m -verbose:gc -Xloggc:../logs/gclog.log -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:

+PrintHeapAtGC -XX:+PrintTenuringDistribution -XX:+HeapDumpOnOutOfMemoryError %JAVA_OPTS%
rem set JAVA_OPTS=%JAVA_OPTS% -Xint -Xrunjprofiler:port=8849 -Xbootclasspath/a:D:\02.3968\02.softsetup\jprofiler7\bin\agent.jar;

 

2.Jprofiler集成参数配置
set JAVA_OPTS=%JAVA_OPTS% -agentpath:D:\022F9C~1.396\025CBC~1.SOF\JPROFI~1\bin\windows\jprofilerti.dll=port=8849,nowait 

//具体的Jprofiler参数,通过Jprofiler的session 集成向导提示设置;

 在对本地的应用进行跟踪时,向导提示如下:

Integration type: [Generic application]
Selected JVM: Oracle 1.6.0 (hotspot)
Startup mode: Startup immediately, connect later with the JProfiler GUI

(1) Please insert

-agentpath:D:\022F9C~1.396\025CBC~1.SOF\JPROFI~1\bin\windows\jprofilerti.dll=port=8849,nowait

into the start command of your remote application right after the java command.

A remote session named Remote application on localhost will be created that connects to a running instance of the remote application that is started with the modified start command.

 

由向导可知,将-agentpath:D:\022F9C~1.396\025CBC~1.SOF\JPROFI~1\bin\windows\jprofilerti.dll=port=8849,nowait 加入到启动文件的JAVA_OPTS可即可

 

3.配置的具体位置:

catalina.bat文件中

rem ----- Execute The Requested Command ---------------------------------------

set JAVA_OPTS=-Xms200M -Xmx500M  -XX:PermSize=128M -XX:MaxPermSize=256m -verbose:gc -Xloggc:../logs/gclog.log -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:

+PrintHeapAtGC -XX:+PrintTenuringDistribution -XX:+HeapDumpOnOutOfMemoryError %JAVA_OPTS%
rem set JAVA_OPTS=%JAVA_OPTS% -Xint -Xrunjprofiler:port=8849 -Xbootclasspath/a:D:\02.3968\02.softsetup\jprofiler7\bin\agent.jar;
set JAVA_OPTS=%JAVA_OPTS% -agentpath:D:\022F9C~1.396\025CBC~1.SOF\JPROFI~1\bin\windows\jprofilerti.dll=port=8849,nowait

echo Using CATALINA_BASE:   %CATALINA_BASE%
echo Using CATALINA_HOME:   %CATALINA_HOME%
echo Using CATALINA_TMPDIR: %CATALINA_TMPDIR%

 

4.Linux调优参数:
   catalina.sh文件中:

   ---本地vmware linux(Centos)调试验证参数:

JAVA_OPTS="$JAVA_OPTS -Xms512m -Xmx512m -Xss1024K -XX:PermSize=128m -XX:MaxPermSize=128m -

XX:MaxTenuringThreshold=0 -Xnoclassgc -XX:+DisableExplicitGC -XX:+UseParNewGC -XX:

+UseConcMarkSweepGC -XX:+UseCMSCompactAtFullCollection -XX:CMSFullGCsBeforeCompaction=0 -XX:

+CMSClassUnloadingEnabled -XX:-CMSParallelRemarkEnabled -XX:CMSInitiatingOccupancyFraction=90

-XX:SoftRefLRUPolicyMSPerMB=0 -XX:+PrintClassHistogram -XX:+PrintGCDetails -XX:

+PrintGCTimeStamps -XX:+PrintHeapAtGC"

 

---生产环境 linux参数V0.1:

JAVA_OPTS="$JAVA_OPTS -Xms6000m -Xmx6000m -Xss1024K -XX:PermSize=512m -XX:MaxPermSize=512m -

XX:MaxTenuringThreshold=0 -Xnoclassgc -XX:+DisableExplicitGC -XX:+UseParNewGC -XX:

+UseConcMarkSweepGC -XX:+UseCMSCompactAtFullCollection -XX:CMSFullGCsBeforeCompaction=0 -XX:

+CMSClassUnloadingEnabled -XX:-CMSParallelRemarkEnabled -XX:CMSInitiatingOccupancyFraction=90

-XX:SoftRefLRUPolicyMSPerMB=0 -XX:+PrintClassHistogram -XX:+PrintGCDetails -XX:

+PrintGCTimeStamps -XX:+PrintHeapAtGC -Xloggc:log/gc.log"

 

---生产环境 linux参数V0.2:

JAVA_OPTS="$JAVA_OPTS -Xms8000m -Xmx8000m -Xss1024K -XX:PermSize=512m -XX:MaxPermSize=512m -

XX:MaxTenuringThreshold=0 -Xnoclassgc -XX:+DisableExplicitGC -XX:+UseParNewGC -XX:

+UseConcMarkSweepGC -XX:+UseCMSCompactAtFullCollection -XX:CMSFullGCsBeforeCompaction=8 -XX:

+CMSClassUnloadingEnabled -XX:-CMSParallelRemarkEnabled -XX:CMSInitiatingOccupancyFraction=90

-XX:SoftRefLRUPolicyMSPerMB=0 -XX:+PrintClassHistogram -XX:+PrintGCDetails -XX:

+PrintGCTimeStamps -XX:+PrintHeapAtGC -Xloggc:log/gc.log"

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值