[Borges-users] current memory issues

Слепнев Владимир slepnev_v at rambler.ru
Thu Apr 29 07:05:10 EDT 2004


>I was looking for it the last time you asked the question, but could not
>find it either. I think that it somehow is logic to loose some memory
>for a given period of time, since recalling repeatedly means recreating
>stuff and snapshotting multiple branches. Where I loose the problem is
>that I think that this stuff should get reclaimed by the gc, while it is
>not. There must be a link to all these classes somewhere, blocking
>things from being gc'ed.
>
>I propose that we share our insights on the problem, trying to describe
>what should happen and trying to find out what does not.
>
>Second proposition: We need to develop a debugging toolkit for Borges.
>That starts with the improvement of display in ObjectSpaceBrowser (which
>can be very useful) and maybe even the creation of new tools.
>
>Can you try to describe your model of the problem ?

OK. Here's what I could come up with.

1) If we set will_answer? of the called component to false, the 
problem goes away. The only difference will_answer? makes is saving a 
continuation.

2) The component instances should get GC'ed when they go out of scope, 
regardless of what their @continuation variable is. So, a component 
instance does not get GC'ed only because it is referenced in the 
@continuation variable of some _other_ component instance.

3) This means, e.g., that the @continuation variable of the second 
created instance of the component somehow references the first created 
instance, so we get a chain of references (something like the one we 
discussed in "delegate and controller" via the 'saved' variable).

4) Continuation objects are opaque, so ObjectSpaceBrowser won't help 
us to determine which objects are referenced from a given 
continuation. A continuation is supposed to save only the stack and 
local variables of all functions; maybe it also saves something else? 
I don't know.

Maybe at some moment I'll have to look at the C source for Ruby's 
callcc. I don't want to do it now - still keep hoping it's just a typo 
somewhere in Borges.

Vladimir Slepnev


More information about the Borges-users mailing list