IntrospectorCleanupListener作用
来源:互联网 发布:普瑞软件 编辑:程序博客网 时间:2024/06/02 20:29
IntrospectorCleanupListener作用
<!--web.xml--><listener> <listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class></listener>
1、此监听器主要用于解决java.beans.Introspector导致的内存泄漏的问题
2、此监听器应该配置在web.xml中与Spring相关监听器中的第一个位置(也要在ContextLoaderListener的前面)
3、JDK中的java.beans.Introspector类的用途是发现Java类是否符合JavaBean规范如果有的框架或程序用到了Introspector类,那么就会启用一个系统级别的缓存,此缓存会
存放一些曾加载并分析过的JavaBean的引用。当Web服务器关闭时,由于此缓存中存放着这些JavaBean的引用,所以垃圾回收器无法回收Web容器中的JavaBean对象,最后导致
内存变大。而org.springframework.web.util.IntrospectorCleanupListener就是专门用来处理Introspector内存泄漏问题的辅助类。IntrospectorCleanupListener会在
Web服务器停止时清理Introspector缓存,使那些Javabean能被垃圾回收器正确回收。Spring自身不会出现这种问题,因为Spring在加载并分析完一个类之后会马上刷新
JavaBeans Introspector缓存,这就保证Spring中不会出现这种内存泄漏的问题。但有些程序和框架在使用了JavaBeans Introspector之后,没有进行清理工作(如 Quartz,Struts),最后导致内存泄漏
阅读全文
0 0
- IntrospectorCleanupListener作用
- IntrospectorCleanupListener作用
- IntrospectorCleanupListener作用
- IntrospectorCleanupListener作用
- IntrospectorCleanupListener作用
- IntrospectorCleanupListener作用
- IntrospectorCleanupListener作用
- IntrospectorCleanupListener作用
- 既然琴瑟起 IntrospectorCleanupListener作用
- IntrospectorCleanupListener
- IntrospectorCleanupListener
- IntrospectorCleanupListener
- IntrospectorCleanupListener
- org.springframework.web.util.IntrospectorCleanupListener作用
- org.springframework.web.util.IntrospectorCleanupListener的作用
- Spring框架中IntrospectorCleanupListener的作用
- org.springframework.web.util.IntrospectorCleanupListener监听器的作用
- org.springframework.web.util.IntrospectorCleanupListener监听器的作用
- spring源码研究(0)
- 在其他activity中使用layout下的布局文件及控件方法
- 比特币挖矿——控制器与矿机
- js计算精度
- Android 二维码的扫描,识别与生成功能使用简介
- IntrospectorCleanupListener作用
- Android自定义控件(二 .3)Path贝塞尔曲线
- 对象赋值(=)、引用(&)、克隆(clone)的区别
- python学习-Day9-练习题复习
- 树剖Ⅰ-货车运输:树剖+最大生成树
- Qt中QMenu的菜单关闭处理方法
- OSI参考模型通信举例
- 微信端浏览器不会自动播放视频音频
- 并发编程模型