Tomcat6 Initial Memory settings

Source: Internet
Author: User
Tags xms


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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.