On 15 February 2012 01:18, Igor Stasenko <siguc...@gmail.com> wrote:
> On 15 February 2012 01:11, Igor Stasenko <siguc...@gmail.com> 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
>>
>
> btw, i found it strange that #pointersTo does not reports a context of
> closure, which apparently
> holds a strong reference to semaphore, i.e. the following must yield true:
>
>
> | sema |
> sema := Semaphore new.
> sema pointersTo includes: thisContext
>
ah, ok, it seems to be intended by implementation:

objectsToAlwaysExclude := {
                thisContext.
                thisContext sender.
                thisContext sender sender.
                objectsToExclude.
        }.

>
>
> --
> Best regards,
> Igor Stasenko.



-- 
Best regards,
Igor Stasenko.

Reply via email to