Hi Seema, On Thu, 2009-03-12 at 10:37 -0700, seemamani wrote: > We are using MyFaces 1.1.5 in our web application deployed in WAS 6.1. > Recently we faced some memory issues due to session size. We have set the > STATE_SAVING_METHOD as server in web.xml. > > Our WebSphere support team found several of the myfaces classes used in the > session data. They want us to analyze why there is so much data in session > and optimize wherever possible. Here is the list of classes that they sent. > > org.apache.myfaces.application.jsp.JspStateManagerImpl$SerializedViewCollection > org.apache.myfaces.application.jsp.JspStateManagerImpl$SerializedViewKey > org.apache.myfaces.application.TreeStructureManager$TreeStructComponent > org.apache.myfaces.application.ApplicationImpl > javax.faces.component._AttachedStateWrapper > javax.faces.FactoryFinder > > How can we reduce these information in the session. Apart from what is > mentioned in the below link, is there anything else we need to do? > http://wiki.apache.org/myfaces/Performance >
The first 5 are expected. These objects are all related to the cache of previously-visited views. One (most recent) is kept to support normal JSF operations. Up to N older views are kept to support back-button usage. The "performance" page you quote describes how to reduce the NUMBER_OF_VIEWS_IN_SESSION to reduce memory usage (ie support less back-button depth). And that page also describes the SERIALIZE_STATE_IN_SESSION (enabled by default anyway) and COMPRESS_STATE_IN_SESSION options. Of course the best way to reduce session size is to use client-side state, in which case zero session space is needed for the view trees. The disadvantage is that network traffic increases (page size is larger).. I'm a little surprised to see FactoryFinder in this list. Are you sure this is right? I've just checked, and FactoryFinder is indeed a class with just static methods. So there should not even be *one* instance. It does have a few static members, but they should not be particularly large. Regards, Simon