Solution to Tomcat memory overflow (java. lang. OutOfMemoryError: PermGen space)

Source: Internet
Author: User

The following error is reported when Tomcat is started:

Java. lang. OutOfMemoryError: PermGen space



Solution:
Configure the memory size. There are three cases as follows:
A): If the tomcat plug-in of eclipse starts tomcat, add the following JVM parameters to the "window" menu-"Preferences"-"Tomcat"-"JVM Settings:
-Xms128M-Xmx512M-XX: PermSize = 128 M-XX: MaxPermSize = 256 M

B): If tomcat is installed as a windows Service and started from the service, open the Registry Editor and navigate: HKEY_LOCAL_MACHINE \ SOFTWARE \ Apache Software Foundation \ Procrun 2.0 \ tomcat6 \ Parameters \ Java (the Win7 X64 system is located in HKEY_LOCAL_MACHINE \ SOFTWARE \ Wow6432Node \ Apache Software Foundation \ Procrun
2.0 \ tomcat6 \ Parameters \ Java)
Double-click the "Options" key in the right window and add the following line:
-XX: PermSize = 128 M
-XX: MaxNewSize = 256 m
-XX: MaxPermSize = 256 m

C): If tomcat is started using the command line method, modify the script file (catalina in Windows. bat, Which is catalina in Linux. sh). In the same way, add the above parameters to the JAVA_OPTS variable.

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.