Before we solve this problem, let's take a look at what is PermGen space
PermGen space is the full name of permanent Generation space, refers to the memory of the permanent storage area Outofmemoryerror:permgen space from the surface is the memory benefits, the solution must be to increase memory.
tell me why memory benefits :
(1) This section is used to store class and meta information, which is placed in the PermGen space area when loaded, and is different from the heap area where the instance is stored.
(2) GC (garbage Collection) does not clean up permgen space during the main program run time, so if your app will load many classes, PermGen space error is likely to occur. This error is common when the Web server pre-compile the JSP.
If you have a large number of third-party jars under your web app that are larger than the JVM's default size (4M), this error message will be generated.
Recommendation: Move the same third-party jar files to the Tomcat/shared/lib directory, which reduces the memory consumption of the jar document
First step: Double-click the Tomcat server->overview->open lauch configuration-->arguments
You can also open the above interface in the following way:
Click "Run" – "Run configurations ...", select Tomcat Server, go to arguments paging
Step Two: Modify the VM arguments configuration and add parameters to increase the initial allocation space
-xms256m-xmx1024m-xx:P ermsize=256m-xx: MaxPermSize
Explanation of the parameters
-xms256m: Indicates that the minimum memory for the virtual machine occupies the system is 256M.
-XMX1024M: Indicates that the maximum memory for the virtual machine occupies the system is 1024M.
-xx:permsize: Minimum heap size. Generally reported insufficient memory, are said that this is too small, the remaining capacity of the heap space is less than 5% will be warned, it is recommended to set this slightly larger, depending on the size of their own machine memory settings
-xx:maxpermsize: Maximum heap size. This one's a little bigger.
complementary points of knowledge :
How to modify JVM memory size under Linux
To add the catalina.sh under Tomcat's bin, position cygwin=false before. Note the quotation marks to be taken, red for the newly added.
# OS specific support. $var _must_ is set to either true or false.
Java_opts= "-xms256m-xmx512m-xss1024k-xx:permsize=128m-xx:maxpermsize=256m"
Cygwin=false
Eclipse Runtime Java.lang.OutOfMemoryError:PermGen Space Solution