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