由于 DefaultListableBeanFactory 对象,jboss 服务中的内存泄漏 [英] Memory leak in jboss service due to DefaultListableBeanFactory objects

查看:115
本文介绍了由于 DefaultListableBeanFactory 对象,jboss 服务中的内存泄漏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的 jboss 服务中,出现内存泄漏.我检查了堆转储,我看到堆的主要部分被 DefaultListableBeanFactory 和 ConcurrentHashMap 占用.

我遇到过这个问题已经报告了,https://jira.spring.io/browse/SPR-9842

我的问题也一样,但我使用的是 spring(spring-beans) 版本 3.1.1.RELEASE.如果这实际上是 spring 的问题还是我的代码有问题,有人可以帮忙吗?另外如果是spring的问题,有什么解决办法?

谢谢

解决方案

我找到了问题的原因.问题是,在代码 ClassPathXmlApplicationContext 对象针对每个请求进行实例化.

我将 ClassPathXmlApplicationContext 对象更改为静态对象,现在我不再面临这个问题.感谢支持.

链接中的评论说明了问题,https://jira.spring.io/browse/SPR-7502?focusedCommentId=57240&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-57240>

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆