Resolving memory leaks caused by java.beans.Introspector

Source: Internet
Author: User

Solution Solutions :

in the WEB. Configure the Listener in XML :

<listener>

<listener-class>

Org.springframework.web.util.IntrospectorCleanupListener

</listener-class>

</listener>

cause :

Introspectorcleanuplistener refreshes the introspector cache of the JDK's JavaBeans when the Web application is closed. Register this listener in your Web. XML to make sure that the class loader for the application and its loaded classes are releasing the resources correctly.

A listener named Org.springframework.web.util.IntrospectorCleanupListener is provided in spring. It is primarily responsible for handling buffer leaks caused by the use of JavaBeans introspector. It is described in spring as follows: It is a listener that clears the JavaBeans introspector when the Web application is closed. Web. XML to register this listener Apply the associated class loader and the classes it manages if you use JavaBeans introspector to analyze classes in your app, the introspector buffer retains references to those classes. Results when your app is closed, these classes and the Web The application-related class loader is not garbage collected. Unfortunately, the only way to clear introspector is to flush the entire buffer. This is because we cannot judge which references are part of your application. So, delete In addition to the buffered introspection, the introspection of all applications on this computer will be erased. It is important to note that the spring The managed bean does not need to use this listener. Because the buffers used by spring's own introspection are parsed out of a class and are immediately removed from the JavaBeans Introspector in the buffer. Classes in your application never use JavaBeans introspector directly. So they generally do not cause internal viewing of resource leaks. But some class libraries and frameworks often produce this problem. For example: Struts and quartz. A single internal view leak can cause the entire web app's classloader to not be garbage collected. After the web app is closed, you'll see all of the static class resources for this app (for example, Singleton). This error is certainly not caused by the class itself.

Resolving memory leaks caused by java.beans.Introspector

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.