Exception in Thread "Http-bio-8080-exec-2" Java.lang.OutOfMemoryError:PermGen

Source: Internet
Author: User
Tags xms


Question: Start the Tomcat times error, and keep on going



Exception in Thread "Http-bio-8080-exec-2" Java.lang.OutOfMemoryError:PermGen



Exception in Thread "http-bio-8080-exec-3" Java.lang.OutOfMemoryError:PermGen



Exception in Thread "http-bio-8080-exec-4" Java.lang.OutOfMemoryError:PermGen



Exception in Thread "Timer-0" Java.lang.OutOfMemoryError:PermGen









Solve



Memory Overflow AH ~



Workaround: 

1, manually set MaxPermSize size



Modify Tomcat_home/bin/catalina.bat (catalina.sh under Linux) and add the following line to the "echo" Using catalina_base: $CATALINA _base "":



setjava_opts=%java_opts%-server-xx:permsize=128m-xx:maxpermsize=512m



Catalina.sh under:



java_opts= "$JAVA _opts-server-xx:permsize=128m-xx:maxpermsize=512m"



2, modify the contents of the Tomcat_home/bin/catalina.bat file: After%_execjava%%java_opts% add:



-xms=256m-xmx512m



Look, there are spaces around.






For example:%_execjava%%java_opts%-xms=256m-xmx512m (space), the contents of the following unchanged






3, you can consider the same third-party jar files copied to the Tomcat/shared/lib directory, which can reduce the memory of the jar file re-use. 


4,Increase the starting memory parameters for the JDK specified by the Tomcat



-xms128m-xmx512m-xx:permsize=128m-xx:maxpermsize=128m








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.