[Seaside] Image not release the memory in a Seaside session

Philippe Marschall philippe.marschall at gmail.com
Wed Dec 1 07:06:12 UTC 2010

2010/11/30 Andrés Garagiola <andresgaragiola at gmail.com>:
> Hi list,
> I have a problem with a Seaside session memory consumption. In my system
> there are a seaside session that should run for a long time (many days or
> months), this session is running a page that have JQuery code. This JQuery
> reload certain parts of the website by 5 seconds intervals.
> While time is progress then the vm memory is increase and it never release
> this memory. In two days the memory increase of 40 MB to 530 MB. I
> investigate the problem and found that the callbacks are adding in this
> code:
> store: aCallback
>     | key |
>     key := self advanceKey.
>     callbacks
>         at: (aCallback convertKey: key)
>         put: aCallback.
>     aCallback
>         setKey: key
>         callbacks: callbacks.
>     ^ key
> But the old callbacks never are clear, then the GC never collect this
> objects. After a time the image have thousands callbacks that never will be
> collect.

Right, because it's hard/impossible to know which ones you still need
and which ones you don't. You may still links on this page that were
created with the full page rendering and you wouldn't want their
callbacks to be removed, would you? We once limited the number of
callbacks per continuation but that lead to the situation when you
have more links then clicking on the first ones wouldn't work. The
only recommendation I can give you is to do one of those:
 * do full page requests from time to time
 * do not fire off an AJAX reload every 5 seconds and use WebSockets
or Comet instead
 * make the AJAX reloads not require a session/callback, make them go
to a dedicated WARequestHandler

Anyways I created an issue [1] but I don't think we can do much about it.

 [1] http://code.google.com/p/seaside/issues/detail?id=616


More information about the seaside mailing list