[Borges-users] and even more on caching

Слепнев Владимир slepnev_v at rambler.ru
Sun Apr 11 21:38:17 EDT 2004


Some thoughts.

1) I think I understand why SushiNet hogs memory when we hit 'Browse'. 
It just creates a long long chain of delegation that never answers, 
never goes out of scope and never gets GC'ed. We can't help it: it's a 
SushiNet flaw.

2) However, some SushiNet components do answer and should be GC'ed. 
(StoreItemView) This also doesn't happen, because StateRegistry/Weak:: 
is flawed somewhere. 

3) I reimplemented StateRegistry without weak references, and removed 
StateHolder ('cause it's a hack) from my copy of Borges; the resulting 
thing is quite stable when the number of components is bounded (my 
app), but SushiNet is not like that.

4) If the total number of components ever created by a session is 
bounded, the strong-reference StateRegistry is ok. But we need a more 
general case: the number of components simultaneously in scope is 
bounded. (SushiNet fails here, but it's a SushiNet problem.)

5) A workaround could be to get rid of StateRegistry altogether, and 
make every controller responsible for backtracking its instance 
variables. (The app developer will have to do something like 
register_for_backtracking([:var1,:var2]).)  I'm thinking about that.

Vladimir Slepnev


More information about the Borges-users mailing list