[ 
https://issues.apache.org/jira/browse/TRINIDAD-1812?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14653507#comment-14653507
 ] 

Jesper Steen Møller commented on TRINIDAD-1812:
-----------------------------------------------

FWIW, the issue seen here is duplication of objects under PageFlowScope on 
non-master servers, NOT the view state (which is covered in TRINIDAD-1779). So 
it is a different issue.

The duplication happens because the page flow scope is implemented as a number 
of different key/values under the session (using a 
org.apache.myfaces.trinidadinternal.util.SubKeyMap). For each request where the 
page flow scope is used, a new session map key is used, and the entire scope is 
serialized and sent to the backup servers, even if the individual values are 
unchanged.

For deep object trees or big objects, this overhead is considerable. IMHO, 
that's probably a design problem in the application as well.

The workaround we employed in this case was to use a custom 
PageFlowScopeProvider which introduces another layer of indirection, using a 
session map key for each individual value stored in the page flow scope. That 
way, only truly new values stored into the page flow scope would ever be backed 
up, at the cost of some bookkeeping overhead. If anyone wants it, I can explain 
further or attach the code.


> Memory use is very high in J2EE cluster with session replication (Weblogic) 
> when using pageflowscope
> ----------------------------------------------------------------------------------------------------
>
>                 Key: TRINIDAD-1812
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1812
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>          Components: Components
>    Affects Versions: 1.2.7-core
>         Environment: Weblogic 10 and all versions forward.
>            Reporter: Nicolai Marck Ødum
>            Priority: Critical
>         Attachments: trinidad_demo_1.2.13.war, 
> trinidad_demo_1.2.13_sources.jar
>
>
> In a Weblogic cluster with session replication the memory use (the size of 
> the web session) is much higher on the server that has a copy of the session 
> then on the primary server.
> The problem is related to multiple session attributes that have references to 
> the same shared object in Trinidad. This design has a negative side effect 
> with Weblogic because of the transitive closure ff session attributes. The 
> shared object (and the object graph below it) is copied for each attribute.
> I have created a simple guide with a modified example of the demo application 
> from Trinidad that shows the problem.



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

Reply via email to