Tomcat appears outofmemoryerror: permgen Space

Source: Internet
Author: User

Recently, when deploy the project developed on Tomcat 5.5 to JBoss 4.2, Java will appear during the operation for a period of time. lang. outofmemoryerror: permgen space, initially thought it was caused by an endless loop in the code, but later found that the problem was random, this is not the case in some cases. I suspect that the memory leak is caused. I tried to increase the heap memory, but the same problem has not occurred in Tomcat. Is it a JBoss problem?

I made some searches on the Internet to get some related content.

Permgen space stands for permanent generation space, which refers to the permanent storage area of the memory outofmemoryerror: permgen space is actually out of memory, and the solution must be to increase the memory. This part is used to store class and meta information. When the class is loaded, it is placed in the permgen space area, which is different from the heap area where the instance is stored, GC (garbage collection) does not clean up permgen space during the main program running period. Therefore, if your app loads many classes, permgen may occur.
Space error. This error is common when the web server pre-compile the JSP.

Correction Method:-xms256m-xmx512m-XX: maxnewsize = 256 m-XX: maxpermsize = 256 m

Because many jar packages are referenced in the project, the class information in these jar packages will be loaded to the permgen space area by the JBoss class loader,By default, the size of this part of space is only 4 MB.In the case of many jar packages, it is obviously not enough, so you can solve the problem by specifying the maximum value through-XX: maxpermsize = 256 m.

In addition, if Java. Lang. outofmemoryerror: Java heap space occurs when the heap memory is insufficient, you can use-xmx512m to specify the maximum heap memory to solve this problem.

 

Original article: http://www.blogjava.net/paulwong/archive/2012/02/21/370442.html

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.