Tomcat performance tuning appears java.lang.OutOfMemoryError:PermGen space

Source: Internet
Author: User

Tomcat in the deployment application, server error: Java.lang.OutOfMemoryError:PermGen space, the problem is that Tomcat memory allocation is too small.

Workaround 1:

Modify the Tomcat\bin\catalina.bat file.
Found it

Tomcat6 for

Set java_opts=%java_opts%-djava.util.logging.manager=org.apache.juli.classloaderlogmanager- Djava.util.logging.config. file="%catalina_base%\conf \logging.properties"

Tomcat 7 is

Set Logging_manager=-djava.util.logging.manager=org.apache.juli.classloaderlogmanager

This sentence. Add rem comment off in front.

Under it, add the following:

Set java_opts=-server-xms1024m-xmx1024m-xss512k-xx:permsize=64m-xx:maxnewsize=256m-xx:maxpermsize=128m- Djava.awt.headless=True

Reboot tomcat and boot up normally.
The following modifications are configured as follows

if " %logging_manager% " "" Goto Nojulimanagerrem Set Logging_manager=-djava.util.logging.manager=  Org.apache.juli.ClassLoaderLogManagerset java_opts=-server-xms1024m-xmx1024m-xss512k-xx:permsize=256m-xx: Maxnewsize=512m-xx:maxpermsize=512m-djava.awt.headless=True

Workaround 2:

Add the following line to the "echo" Using catalina_base: $CATALINA _base "":

REM-----Execute The requested Command---------------------------------------set java_opts=-server-xms512m -xmx512m-xss512k-xx:permsize=128m-xx:maxnewsize=256m-xx:maxpermsize=256m-djava.awt.headless=True

Such as:

REM-----Execute The requested Command---------------------------------------set java_opts=-server-xms512m -xmx512m-xss512k-xx:permsize=128m-xx:maxnewsize=256m-xx:maxpermsize=256m-djava.awt.headless=true  echo using catalina_base:   "%catalina_base%"echo using catalina_home:   "%catalina_home%"echo"%catalina_tmpdir% "

Recommendation:

The same third-party jar file is moved to the Tomcat/shared/lib directory, which reduces the memory consumption of the jar document.

Tomcat performance tuning appears java.lang.OutOfMemoryError:PermGen space

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.