2 Replies Latest reply: Mar 27, 2012 7:23 AM by Dimitar Dimitrov RSS

    VIEW SCOPE IS NOT RELEASING PROPERLY IN ADF

    690917
      Hi,

      Our application is developed based on JDeveloper 11 and we have used VIEW scope extensively in our application.

      We have monitored our application with JProfile and identified that the View Scope instances are not getting released even after we navigate from the respective pages to another and the instances getting added whenever we come back to the same page.

      This is creating big impact on the heap side.

      Can you please advise us how to rectify the issue?

      Thanks in advance.
        • 1. Re: VIEW SCOPE IS NOT RELEASING PROPERLY IN ADF
          John Stegeman
          Jeethi,

          It is not an issue (I downloaded an evaluation copy of JProfiler to check it out).

          JProfiler shows all instances of the class in memory (including unreferenced ones). If you force run the garbage collector (there is a button in JProfiler to do so), you will see the instance count go back down to the "correct" number.

          Note: JDeveloper has a memory profiler that appears to show the number "correctly"

          John
          • 2. Re: VIEW SCOPE IS NOT RELEASING PROPERLY IN ADF
            Dimitar Dimitrov
            PageFlowScopes are not released explicitly when the user leaves the corresponding taskflow or JSF page. They remain in a PageFlowScope cache in order to be available if the user navigates back by clicking the browser's Back button. This cache is of a fixed size (which is configurable), so the PageFlowScopes are released implicitly when they fall out of the cache (e.g. when a corresponding number of new entries are put into the cache). Please, have a look about the parameter <tt><page-flow-scope-lifetime></tt> here:

            http://myfaces.apache.org/trinidad/devguide/configuration.html#trinidad-config.xml

            I suspect that the situation with the ViewScopes is similar (i.e. they are cached too and will be released when a corresponding number of new entries is put into the cache), so you should not expect the ViewScope of the page that you have just left to be released and garbage collected immediately. Please, have a look here about view state caching, although it is related to the ViewScopes indirectly:

            http://docs.oracle.com/cd/E21764_01/web.1111/b31973/ap_config.htm#CEGCIDAB

            Dimitar