tomcat/JVM 内存设置

对JVM进行的配置:

1. tomcat: %CATALINA_HOME%\bin\catalina.bat 中最上面增加:
set JAVA_OPTS=-server -Xms800m -Xmx1024m -XX:PermSize=64M -XX:MaxNewSize=256m -XX:MaxPermSize=512m -Djava.awt.headless=true


2. eclipse Run: Run Configuration jre ==> VM arguments
-server -Xms512m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=512m -XX:+CMSClassUnloadingEnabled -XX:+PrintGCDetails -Xloggc:%M2_HOME%/gc.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=%M2_HOME%/java_pid.hprof


3. eclipse server: server ==> Opern launch configuration ==> Argument ==> VM arguments
-Xms512m -Xmx512m -Xmn128m


4. xxx.bat
java -Xms512m -Xmx512m -Xmn128m -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:gc.log -Dwrite.statistics=true -Djava.ext.dirs="./lib" "com.alibaba.dubbo.rpc.benchmark.RpcBenchmarkClient"  > "benchmark.log"


注意:Djava.ext.dirs="./lib" 指定lib目录

你可能感兴趣的:(jvm)