[Seaside] WeakArray (again)

William Harford seaside at harford.org
Fri Mar 24 19:09:30 UTC 2006

On Mar 24, 2006, at 1:23 PM, David Shaffer wrote:

> 1) as you mentioned, remove the use of WeakIdentityKeyDictionary in
> WAStateRegistry...this will mean you're sessions grow continually  
> but is
> OK for relatively short-lived sessions.

I can't do this. Our sessions are long lived and make numerous calls/ 
render. Doing this would quickly use up gobs of memory.

> 2) force session reclaimation on a periodic basis rather than checking
> every ~10 requests (set up a service to call
> WARegistry>>unregisterExpiredHandlers periodically and perform a
> fullGC).  Unregistering sessions can be expensive and it happens on
> average every time 10 new sessions are created.  This means that  
> expired
> sessions will hang around during periods of inactivity which are  
> usually
> the best times to reclaim them and GC.  I've found that simply  
> checking
> every few minutes improves the first page responsiveness of my largest
> app.  I use a "Service" to do this (attached).

I have written similar code but have not tried it out in a production  
environment. I will give that a try.
Our sessions are long lived so I am not to sure how much a difference  
it will make but it can't hurt and it will clean up some DB  
connection sooner rather than later and that is a good thing.

> 3) "register" a minimal amount of state...still each component uses a
> "state holder" for each decoration (including the component itself).

The application uses call/render a lot. This was one of the main  
draws to using Seaside. It allows us to easily customize the  
application for our clients. We build our entire application out of  
smaller reusable components that can be easily customize/replaced.  
There are ~= 12 (and could go up to 30) components created for each  
request. In most cases the user moves on. Would limiting the number  
of pages a user can backtrack help the situation ?


More information about the Seaside mailing list