Tomcat setting memory and setting in eclipse

Source: Internet
Author: User

This is reprinted. The original log is http://nxzhaoning.blog.sohu.com/95873512.html;

 

By default, Tomcat can use a small amount of memory. In a large application project, the memory is insufficient, and the system may fail to run. A common problem is the error of Tomcat memory overflow. the out of memory (insufficient system memory) causes the client to display the Error 500. Generally, the problem can be solved by adjusting the memory usage of Tomcat.

 

Modify the "% tomcat_home %/bin/Catalina. Bat" file in windows and add the following settings at the beginning of the file: Set java_opts =-xms256m-xmx512m

Modify the "% atat_home %/bin/Catalina. Sh" file in Linux and add the following settings at the beginning of the file: java_opts = '-xms256m-xmx512m'

Here,-XMS sets the initial memory size and-xmx sets the maximum memory that can be used.

  

Tomcat 6 has no Catalina. BAT file in some versions. In this case, run the % atat_home %/bin/tomcat6w.exe file to modify the values of initial memory pool and maximum memory pool, which are 256 and 512 respectively.

However, when Tomcat is started in the eclipse environment, it seems that the memory is still small because it is not affected by the parameters set above. Therefore, you need to reset it in eclipse.

 

 

 

 

1. From the menu [windows], select [preferences...]

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

2. Select [myeclipse]-[servers]-[Tomcat]-[Tomcat 6.x] on the left, enable on the right, and click [browse ..].

 

3. Select the tomcat installation directory and click [OK].

 

 

4. Selected page

 

 

5. Expand Tomcat 6.xon the left and select JDK. The system's JDK list is displayed on the right. You can click [add] to add a new JDK. For details, see the JDK installation section.

 

 

6. You can also select an appropriate JDK

 

 

7. Fill in the memory parameters in the JVM parameters according to the machine's situation (note that the Tomcat memory is set here)

 

 

 

8. Select lanch on the left and the default [debug mode] debugging mode on the right. Tomcat can automatically detect changes to the class and JSP files. Click [Create Lance configuration]

 

Now, the configuration for tomcat6.0 is basically complete.

 

9 if there is no special need, we do not recommend modifying the parameters here.

 

 

10 parameters page, the memory parameters we added earlier are displayed at the end

 

 

11. class_path is displayed here. If we have added our classpath (see later), it will also be displayed here.

 

 

 

12 source code page

 

 

 

13. Environment page

 

 

14 JRE configuration page

 

 

 

15 common page, the most important is the right side of the console encoding. Generally GBK/UTF-8 is more

 

 

 

16. Return to the configuration page and select paths on the left. The class_path on the right is our most important concern. Click [add dir] to add the entire directory to class_path.

 

 

17. Select a directory

 

 

 

18. After confirmation, the directory will appear in the list.

 

19. Click [OK]. The setting is complete.

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.