SPRINGMVC Hibernate JVM PermGen Space

Source: Internet
Author: User

Recently the project suddenly appeared "Java.lang.OutOfMemoryError:PermGen space" error, in fact, about PermGen space error explanation, online already have a lot of, excerpt a

The full name of PermGen space is permanent Generation space, which refers to the permanent storage area of memory,
this memory is primarily stored by the JVM with class and meta information, and class is placed in the PermGen when it is loader .
space, which differs from the heap area where the class instance (Instance) is stored, the GC (garbage Collection) does not operate on the main program
PermGen space for cleanup, so if you have a lot of classes in your app, you're likely to be PermGen
Space error, this error is common when the Web server pre-compile the JSP. If your web app uses a large
the size of the third-party jar, which exceeds the default size of the JVM, generates this error message.


Many people have attributed this error to a large extent to the use of spring hibernate ... because they dynamically generate classes (Java reflection), resulting in overflow (spring uses cblib in AOP to produce many classes, Hibernate reflex can also produce many classes )

The reasons are:

It turns out that the Sun's JVM has divided the memory into different areas, one of which is the Permenter area used to store very many classes and class descriptions. Sun was designed to think the area was fixed when the JVM started, but he didn't expect it to be used so extensively. And this area has a special garbage recovery mechanism, now the problem is that the dynamic loading class to this area, the GC has no way to recycle!


There are a lot of solutions, so we don't put them on ...


Personally, there is a certain relationship between the reasons for this problem and the use of these frameworks ...


(PS: If Tomcat runs multiple systems, the same third-party jar files are moved to the Tomcat/shared/lib directory, which can reduce
The jar document is used repeatedly for memory purposes. )

SPRINGMVC Hibernate JVM 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.