1 Reply Latest reply on Mar 29, 2010 7:14 AM by sangaurav

    Objects are not garbage collected on page reload.

    sangaurav
      I'm working on Seam-Spring hybrid application. In this application we have extensively used RichFaces ExtendedDataTable. Yesterday, while analyzing the performance of our application, using JProfiler, we have faced a major performance bottleneck in our application.

      The lists associated with the data tables are not collected by GC on refreshing the page. Instead its size increase in multiple of the data in list. For example if list have 10 objects, on refreshing the page for 5 times the list size would become 50. It keeps increasing so on each time the page is reloaded.

      Even if I move to the different page and keep the application idle for more than 20 minutes, still those objects are not garbage collected. I have tried to force the GC using "Run GC" feature but even it didn't help in GC.

      Then after some research on this topic I figure out that there are two JSF configuration parameters which control the number of state saved on the server. Following are those two parameters:

      <context-param>
      <param-name>com.sun.faces.numberOfViewsInSession</param-name>
      <param-value>0</param-value>
      </context-param>

      and

      <context-param>
      <param-name>com.sun.faces.numberOfLogicalViews</param-name>
      <param-value>0</param-value>
      </context-param>

      I have done above configuration in WEB.xml and now the list size doesn't increase each time the page is reloaded.

      Please suggest is the right way to handle this issue? Is there any other way to fix this issue?

      Please help me out.

      Thanks in advance.
      Gaurav Saini