TOMCAT6 memory Configuration
Tomcat Boot Memory settings
Its initial space (i.e.-XMS) is 1/64 of the physical memory, and the maximum space (-XMX) is 1/4 of the physical memory. You can use options such as the-XMN-XMS-XMX provided by the JVM to
To set
example, the following gives reference to the parameter settings of the Java JVM in the 1G memory environment:
Java_opts= "-server-xms800m-xmx800m-xx:permsize=64m-xx:maxnewsize=256m-xx:maxpermsize=128m-djava.awt.headless= True "
Java_opts= "-SERVER-XMS768M-XMX768M-XX:PERMSIZE=128M-XX:MAXPERMSIZE=256M-XX:
Newsize=192m-xx:maxnewsize=384m "
Catalina_opts= "-server-xms768m-xmx768m-xx:permsize=128m-xx:maxpermsize=256m
-xx:newsize=192m-xx:maxnewsize=384m "
Linux:
The catalina.sh in the/usr/local/apache-tomcat-5.5.23/bin directory
Add: java_opts= '-xms512m-xmx1024m '
To add the "M" description is MB, otherwise it is KB, and will report low memory when you start Tomcat.
-XMS: Initial value
-XMX: Max value
-XMN: Minimum value
Windows
Join in front of the Catalina.bat
Set java_opts=-xms128m-xmx350m
If you use the Startup.bat startup Tomcat,ok setting to take effect. Allocate 200M memory successfully.
However, if the Tomcat service is started by using Windows's system service instead of performing startup.bat boot tomcat, the above settings do not take effect.
That means set java_opts=-xms128m-xmx350m didn't work. The 200M memory allocated above is oom.
The Windows service executes Bin\tomcat.exe. He reads the values in the registry, not the Catalina.bat settings.
Solution:
Modify Registry Hkey_local_machine\software\apache SOFTWARE Foundation\procrun 2.0\tomcat6\parameters\javaoptions
The original value is
-dcatalina.home=e:\tomcat 6.0
-dcatalina.base=e:\tomcat 6.0
-djava.endorsed.dirs=e:\tomcat 6.0\common\endorsed
-djava.io.tmpdir=e:\tomcat 6.0\temp
-djava.util.logging.manager=org.apache.juli.classloaderlogmanager
-djava.util.logging.config.file=e:\tomcat 6.0\conf\logging.properties
Join-xms300m-xmx350m
Restart the Tomcat service, Setup takes effect