I sort of doubt Magma uses anything registering external objects but the 
standard Sockets…
While interrupting finalization process _could_ be a culprit, I'd rather watch 
for something like what happened with the InputEventFetcher, where 
registration/deregistration ends up not being symmetric. 

Perhaps Magma tries to reuse existing Socket instances by calls to 
initialize:/acceptFrom: for example?

I think changing ExternalSemaphoreTable to a weak structure would be a really 
bad idea btw.
All of a sudden, you free up slots which were previously taken for insertion of 
old objects.

There is no guarantee the external user of the semaphore will stop using the 
index it was given just because the image no longer holds a reference to the 
object which used to occupy that index.

So if you register a new object in the same slot, in the case of Sockets at 
least, you could potentially end up responding to signals from both the old 
external user, and the new one.

TLDR; Any object registered in this table by definition needs explicit cleanup 
of external users before they are GC'd. Thus, making the table weak makes no 
sense.

Cheers,
Henry

On Feb 15, 2012, at 12:11 AM, Igor Stasenko wrote:

> On 15 February 2012 00:54, Milan Mimica <milan.mim...@gmail.com> wrote:
>> On 14 February 2012 22:55, Igor Stasenko <siguc...@gmail.com> wrote:
>>> 
>>> 
>>> semaphores collect: [:sema |
>>>        sema ->
>>>                (sema pointersTo reject: [:ptr | ptr == arr or: [ptr ==
>>> semaphores ] ] ) ]
>>> 
>>> Can you try invoking it on your image , look for those who has an
>>> empty array, which will mean that there is no references to it except
>>> semaphore table itself.
>> 
>> 
>> There is 69 of such semaphores, out of hundreds in total. Not much :-/
>> On a normal image there is only a few.
>> 
> 
> So, we got a leak somewhere. Can you double-check,
> this is semaphores which in the list which
> when you inspect that list
> will show entries like
> 
> a Semaphore() -> #()
> 
> but not a total number of entries.
> 
> Oh, ok lets just change the code:
> 
> | semaphores arr |
> 
> arr := ExternalSemaphoreTable unprotectedExternalObjects.
> semaphores := arr reject: #isNil.
> 
> semaphores reject: [:sema |
>       (sema pointersTo reject: [:ptr | ptr == arr or: [ptr ==
> semaphores ] ] ) isEmpty not ]
> 
> so, normally this code should answer an empty array.
> If not, then there's leak
> 
> -- 
> Best regards,
> Igor Stasenko.
> 


Reply via email to