You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org> on 2014/09/09 22:42:28 UTC

[jira] [Resolved] (MYFACES-3924) Memory leak in ViewScopeBeanHolder

     [ https://issues.apache.org/jira/browse/MYFACES-3924?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Leonardo Uribe resolved MYFACES-3924.
-------------------------------------
       Resolution: Fixed
    Fix Version/s: 2.2.5
         Assignee: Leonardo Uribe

> Memory leak in ViewScopeBeanHolder
> ----------------------------------
>
>                 Key: MYFACES-3924
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3924
>             Project: MyFaces Core
>          Issue Type: Bug
>    Affects Versions: 2.2.4
>         Environment: Wildfly 8.1.0.Final
>            Reporter: Dan Østerberg
>            Assignee: Leonardo Uribe
>             Fix For: 2.2.5
>
>
> When running som stress tests, we noticed a severe memory leak, which causes our server to crash witin a few minutes when under pressure. It works fine on Mojarra (2.2.8). Our views aren't particularly big, but we do attach some JPA entities to our ViewScoped beans and we thus need them to be cleaned up in reasonable time.
> The views are destroyed properly, but field "storageMap" in org.apache.myfaces.cdi.view.ViewScopeBeanHolder holds onto the references, preventing view state & beans from being GCed.
> To us, the problem seems to be as easy as that method ViewScopeBeanHolder.destroyBeans(String) doesn't remove the destroyed ViewScopeContextualStorage from the map. Simply replacing the initial "storageMap.get(viewScopeId)" with "storageMap.remove(viewScopeId)" in that method solves the memory leak. But maybe there is a reason for not doing so..?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)