Weblogic reports java. lang. OutOfMemoryError: PermGen space, permgen

Source: Internet
Author: User

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.

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.