webtier@glassfish.java.net

Re: [webtier] numberOfViewsInSession and numberOfLogicalViews question and recommendations

From: <webtier_at_javadesktop.org>
Date: Tue, 22 Jul 2008 07:40:51 PDT

If memory utilization is a concern, using 1.2_09 you can enable com.sun.faces.serializeServerState which will serialize and then compress the server state. There are costs with doing this of course as serialization isn't cheap, but the memory savings is significant.

Other things to consider is reviewing your component usage. If there is no real reason for a component to maintain it's state between requests, ensure you mark the component transient so that it's state isn't saved.

I don't have any magic bullets for how you should configure these parameters.
I've gone through the code and see that we could improve logging to show how these maps are being
used to make it easier to tune so I've logged an issue [1] to track this.

For now I would say the best way to figure out the best options for your application is by running through some of the typical workflows and then inspect the maps maintained with the session. You could use special application logic that pulls the maps from the session and displays information about them, or you could attach a debugger and pick through the session that way. The state maps are stored in the session using the key com.sun.faces.logicalViewMap.


[1] https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=760
[Message sent by forum member 'rlubke' (rlubke)]

http://forums.java.net/jive/thread.jspa?messageID=288436