Exception Handling series: Java.lang.OutOfMemoryError:PermGen space

Source: Internet
Author: User

Today help classmates solve his tomcat start problem, reported a outofmemoryerror anomaly, and then search AH search, suddenly found particularly interesting.

First of all, say the solution:

As soon as you see this, you know it's full of memory. So make the Tomcat memory Pool A bit larger.


1. Window-->preferences, and then write "Tomcat" directly in the search box, the following interface appears:
 
2. Select the version of Tomcat you installed, select the following JDK, on the right  
   Optional Java VM arguments text box input:  
  - xmx256m-xms256m-xx:maxpermsize=256m 


Then, click Apply at the bottom, then click OK


Here's a couple of words:

let's explain what PermGen space is .  

the full name of PermGen space is permanent Generation space, which refers to the permanent storage area of memory, which is used to store class and meta information, and class is placed in the PermGen space area when load is loaded. , unlike the heap area where the instance is stored, the GC (garbage Collection) does not clean up permgen space during the main program run time .So if your app is going to load many classes, it's likely that PermGen space error will occur ..

note the red part, which can cause this problem if too many classes are loaded.  
exception: Java.lang.OutOfMemoryError:PermGen space

so the possible reasons are: 
too many classes are loaded
too many jars are loaded
too many jars loaded repeatedly

Exception Handling series: 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.