You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltaspike.apache.org by "Mark Struberg (JIRA)" <ji...@apache.org> on 2015/11/24 13:30:10 UTC
[jira] [Commented] (DELTASPIKE-1033) BeanManagerProvider might
create mem leaks
[ https://issues.apache.org/jira/browse/DELTASPIKE-1033?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15024396#comment-15024396 ]
Mark Struberg commented on DELTASPIKE-1033:
-------------------------------------------
Switching BeanManagerProvider to WeakReference turned out to be much harder than expected...
If I just use a WeakHashMap then the value in the bmInfos Map still holds a strong ref and thus the ClassLoader wont get gced
so it's not worth the change.
if I switch the BeanManagers to WeakReference as well then they get removed too early because I just get a proxy for them.
So the 'real' BeanManager still exists, but the InjectableBeanManager instance (which I have a WeakReference to) got gced...
Someone has a good idea for that topic?
> BeanManagerProvider might create mem leaks
> ------------------------------------------
>
> Key: DELTASPIKE-1033
> URL: https://issues.apache.org/jira/browse/DELTASPIKE-1033
> Project: DeltaSpike
> Issue Type: Bug
> Components: Core
> Affects Versions: 1.5.1
> Reporter: Mark Struberg
> Assignee: Mark Struberg
> Fix For: 1.5.2
>
>
> We currently use a Map<ClassLoader, BeanManagerInfo> in BeanManagerProvider. This is a class 1 candidate to generate mem leaks when a webapp gets undeployed. We should switch to using WeakReferences instead.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)