Tomcat Common Configuration

Source: Internet
Author: User

I. Increase memory to prevent JVM memory overflow

1. When started as a service

Go to the "Tomcat installation path \ Bin" directory, open the Service.bat file, locate "--jvmoptions", and then add the trailing quotation marks

"-XMS256M;-XMX512M;-XX:PERMSIZE=128M;-XX:MAXPERMSIZE=512M;"

2. When started as a process

Go to the "Tomcat installation path \ Bin" directory, open the Catalina.bat file,

Find the "REM-----Execute The requested Command---------------------------------------",

Add "set java_opts=%java_opts%-server-xms256m-xmx512m-xx:permsize=128m-xx:maxpermsize=512m" below

3. When launched in Eclipse

A. Double-click the Tomcat service under the Servers tab

B. In the Tomcat configuration that opens, click Open Launch Configuration

C. Select the Arguments tab and add it at the end of the box under VM arguments

"-xms256m-xmx512m-xx:permsize=256m-xx:maxpermsize=512m"

      Note the preceding space

    

  4. Memory configuration Item Description

-xms256m: Virtual machine occupies the minimum memory of the system

-XMX512M: Virtual machine occupies the maximum memory of the system

-xx:permsize: Minimum stack memory size. Generally reported insufficient memory, are said that this is too small, the remaining heap space is less than 5% will be warned,

It is recommended to set this slightly larger, but depending on the size of your machine's memory

    -xx:maxpermsize: Maximum stack memory size. This one's a little bigger.

-xmx512m 5% is 25.6M, theoretically requires-XMX value and-xx:maxpermsize must be greater than 25.6M

Tomcat Common Configuration

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.