Weblogic reports java. lang. OutOfMemoryError: PermGen space, permgen
Memory overflow is a problem that occurs frequently during software development. When weblogic middleware is used locally, applications may be often packaged and deployed, memory overflow may occur.
1. Problems Found
During deployment, the "Update" function is usually directly used when the same package is encountered. After multiple updates, it is found that the project deployment is getting slower and slower, andjava.lang.OutOfMemoryError: PermGen space,OutOfMemoryErrorIs memory overflow,PermGen spaceIt indicates that an exception occurs in the permanent generation (that is, the method area.
2. analyze the problem
This problem was recorded on the Tomcat Wiki page:
Why does the memory usage increase when I redeploy a web application?
That is because your web application has a memory leak.
A common issue are "PermGen" memory leaks. they happen because the Classloader (and the Class objects it loaded) cannot be recycled unless some requirements are met (*). they are stored in the permanent heap generation by the JVM, and when you redeploy a new class loader is created, which loads another copy of all these classes. this can cause OufOfMemoryErrors eventually.
(*) The requirement is that all classes loaded by this classloader shocould be able to be gc 'ed at the same time.
This is alsoThe rock of the mountains can attack the Jade. The above problem should also occur when the JVM Virtual Machine recycles the content of the permanent generation region, causing memory overflow errors caused by excessive dynamic loading of class files in the application.
3. Solve the Problem
In the bin directory of the weblogic domain (My ID is D: \ Develop \ Weblogic \ wls12120 \ user_projects \ domains \ mydomain \ bin), setDomainEnv. cmd (for linux, modify setDomainEnv. sh), find-XX:MaxPermSize:
set MEM_MAX_PERM_SIZE_64BIT=-XX:MaxPermSize=256mset MEM_MAX_PERM_SIZE_32BIT=-XX:MaxPermSize=256m
This parameter sets the maximum value of the permanent generation region. The default value is 256 MB, which is directly changed to 512 MB (which can be increased according to your computer configuration). Save the parameter and restart weblogic. It is found that weblogic runs faster and this error occurs only when the local memory is occupied by many other applications.
Solve the problem.
Note: PermGen space, permanent heap generation space, that is, permanent generation or method zone.