由于 DefaultListableBeanFactory 对象,jboss 服务中的内存泄漏 [英] Memory leak in jboss service due to DefaultListableBeanFactory objects
问题描述
在我的 jboss 服务中,出现内存泄漏.我检查了堆转储,我看到堆的主要部分被 DefaultListableBeanFactory 和 ConcurrentHashMap 占用.
我遇到过这个问题已经报告了,https://jira.spring.io/browse/SPR-9842
我的问题也一样,但我使用的是 spring(spring-beans) 版本 3.1.1.RELEASE.如果这实际上是 spring 的问题还是我的代码有问题,有人可以帮忙吗?另外如果是spring的问题,有什么解决办法?
谢谢
我找到了问题的原因.问题是,在代码 ClassPathXmlApplicationContext 对象针对每个请求进行实例化.
我将 ClassPathXmlApplicationContext 对象更改为静态对象,现在我不再面临这个问题.感谢支持.
In my jboss service, I get memory leak. I checked the heap dump, I saw the major portion of heap is occupied by DefaultListableBeanFactory and ConcurrentHashMap.
I came across this issue reported already, https://jira.spring.io/browse/SPR-9842
My issue is also the same but I use spring(spring-beans) version 3.1.1.RELEASE. Can somebody help if this is actually a problem with spring or is it a problem with my code? Also if it is a problem with the spring, what is the solution?
Thanks
I found out the cause of the problem. The issue was that, in the code ClassPathXmlApplicationContext object is instantiated for each request.
I changed the ClassPathXmlApplicationContext object to static and now I no longer face this problem. Thanks for the support.
The comment in the link explained the problem, https://jira.spring.io/browse/SPR-7502?focusedCommentId=57240&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-57240
这篇关于由于 DefaultListableBeanFactory 对象,jboss 服务中的内存泄漏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!