Dan Østerberg created MYFACES-3924:
--------------------------------------

             Summary: 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


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)

Reply via email to