`
lvinie
  • 浏览: 111140 次
  • 性别: Icon_minigender_1
  • 来自: 郑州
社区版块
存档分类
最新评论

org.springframework.web.util.IntrospectorCleanupListener是什么东东

    博客分类:
  • java
 
阅读更多

看到好多项目的web.xml中都配置了

<listener>
      <listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class>
</listener>

 这个是什么东东呢?

这是Introspector 缓存清除监听器

        Spring 提供了一个名为 org.springframework.web.util.IntrospectorCleanupListener 的监听器。它主要负责处理由 JavaBean Introspector 功能而引起的缓存泄露。IntrospectorCleanupListener 监听器在 Web 应用关闭的时会负责清除 JavaBean Introspector 的缓存,在 web.xml 中注册这个监听器可以保证在 Web 应用关闭的时候释放与其相关的 ClassLoader 的缓存和类引用。如果您使用了 JavaBean Introspector 分析应用中的类,Introspector 缓存会保留这些类的引用,结果在应用关闭的时候,这些类以及Web 应用相关的 ClassLoader 不能被垃圾回收。不幸的是,清除 Introspector 的唯一方式是刷新整个缓存,这是因为没法准确判断哪些是属于本 Web 应用的引用对象,哪些是属于其它 Web 应用的引用对象。所以删除被缓存的 Introspection 会导致将整个 JVM 所有应用的 Introspection 都删掉。需要注意的是,Spring 托管的 Bean 不需要使用这个监听器,因为 Spring 的 Introspection 所使用的缓存在分析完一个类之后会马上从 javaBean Introspector 缓存中清除掉,并将缓存保存在应用程序特定的 ClassLoader 中,所以它们一般不会导致内存资源泄露。但是一些类库和框架往往会产生这个问题。例如 Struts 和 Quartz 的 Introspector 的内存泄漏会导致整个的 Web 应用的 ClassLoader 不能进行垃圾回收。在 Web 应用关闭之后,您还会看到此应用的所有静态类引用,这个错误当然不是由这个类自身引起的。解决这个问题的方法很简单,您仅需在 web.xml 中配置 IntrospectorCleanupListener 监听器就可以了:

分享到:
评论

相关推荐

    spring-web-2.5.jar

    org.springframework.web.util.IntrospectorCleanupListener.class org.springframework.web.util.JavaScriptUtils.class org.springframework.web.util.Log4jConfigListener.class org.springframework.web.util....

    org.springframework.web的jar包.zip

    import org.springframework.web.socket.server.standard.ServerEndpointExporter;

    Spring框架依赖jar包

    Spring框架依赖jar包,其中最小依赖包:org.springframework.core、org.springframework.context、org.springframework.beans、org.springframework.asm、org.springframework.expression、...

    springboot 基础简易实例, maven项目

    import org.springframework.web.bind.annotation.RestController; // @RestController返回的是json @RestController public class HelloWorldController { // http://localhost:8080/hello 返回的是文本"Hello ...

    spring4.0 API

    spring 4.0 未翻译java.lang....org.springframework.core.OrderComparator (implements java.util.Comparator) org.springframework.core.annotation.AnnotationAwareOrderComparator Annotation Type Hierarchy

    spring jdbctemplate 封裝

    import org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet; import org.springframework.jdbc.support.rowset.SqlRowSet; import org.springframework.jdbc.support.rowset.SqlRowSetMetaData; ...

    spring-framework-3.0.5.RELEASE-dependencies-1

    spring-framework-3.0.5.RELEASE-dependencies 好不容易找到了,赶紧分享一下 因为不能大于20M,共分了8个包,都是...org.springframework.build org.testng org.xmlpull org.joda org.jruby org.junit org.objectweb.asm

    信息: Deploying web application directory lx01

    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053) at org.apache.catalina.core....

    java head space.txt

    org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.OutOfMemoryError: Java heap space at org.springframework.web.servlet.DispatcherServlet....

    struts2驱动包

    nested exception is java.lang.AbstractMethodError: org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator.postProcessAfterInstantiation(Ljava/lang/Object;Ljava/lang/String;)Z at org....

    org.apache.poi jar包

    org.apache.poi JAR包,解决个人的 import org.apache.commons.beanutils.PropertyUtilsBean;...import org.apache.poi.ss.util.CellRangeAddress; "The import org.apache.poi cannot be resolved"的问题

    org.apache.http jar包

    下载HttpClient,解压,在Eclipse中导入所有JAR import org.apache.http.HttpResponse; import org.apache.http.NameValuePair; import org.apache....import org.apache.http.util.EntityUtils;

    spring2.5基于注解例子程序

    spring2.5基于注解的例子程序,包含相关jar包

    org.jbundle.util.osgi.wrapped.org.apache.http.client-4.1.2.jar

    org.jbundle.util.osgi.wrapped.org.apache.http.client-4.1.2.jar

    spring-framework.jar包

    最全的一份spring的jar包,让你在学习spring的时候不用花时间再去找包

    Logincontroller.java

    import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.ModelAndView; import com.mchange.v2.c3p0.ComboPooledDataSource; @Controller @RequestMapping...

    springboot启动类

    import org.springframework.web.client.RestTemplate; @SpringBootApplication public class OfficeServiceApplication { public static void main(String[] args) { SpringApplication.run...

    spring-framework-3.0.5.RELEASE-dependencies-6

    spring-framework-3.0.5.RELEASE-dependencies 好不容易找到了,赶紧分享一下 因为不能大于20M,共分了8个包,都是...org.springframework.build org.testng org.xmlpull org.joda org.jruby org.junit org.objectweb.asm

    spring-framework-3.0.5.RELEASE-dependencies-7

    spring-framework-3.0.5.RELEASE-dependencies 好不容易找到了,赶紧分享一下 因为不能大于20M,共分了8个包,都是...org.springframework.build org.testng org.xmlpull org.joda org.jruby org.junit org.objectweb.asm

    spring-webflux-context-showcase

    展示了如何与org.springframework.web.server.WebFilter reactor.util.context.Context进行交互,就像java.lang.ThreadLocal一样。 org.springframework.cloud.spring-cloud-starter-sleuth有一个很好的解决方案! ...

Global site tag (gtag.js) - Google Analytics