一、IntrospectorCleanupListener
spring中提供了一个名为org.springframework.web.util.IntrospectorCleanupListener的监听器。它主要负责处理由JavaBeans Introspector的使用而引起的缓冲泄露
<!-- 防止内存泄露 -->
<listener>
<listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class>
</listener>
org.springframework.web.util.IntrospectorCleanupListener的监听器。它主要负责处理由JavaBeans Introspector的使用而引起的缓冲泄露。
spring中对它的描述如下:
它是一个在web应用关闭的时候,清除JavaBeans Introspector的监听器.
在web.xml中注册这个listener.
可以保证在web 应用关闭的时候释放与掉这个web 应用相关的class loader 和由它管理的类.
如果你使用了JavaBeans Introspector来分析应用中的类,
Introspector 缓冲中会保留这些类的引用.结果在你的应用关闭的时候,
这些类以及web 应用相关的class loader没有被垃圾回收.
不幸的是,清除Intro