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"