Re: [Pharo-dev] fun with announcers

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-dev] fun with announcers

Eliot Miranda-2
 
Hi Denis, Hi All,

On Wed, May 9, 2018 at 1:35 AM, Denis Kudriashov <[hidden email]> wrote:
I checked on my few days image. And I have >2000 announcers.
Cleaning Calypso cache does not help. And in fact after closing all browsers and collecting garbage the cache became empty.

I found that most of subscriptions are related to rubric announcements. 

Can you tell me whether this is an application bug or possibly a bug with the Spur VMs weak collections?  I'd hate for this to be an undiagnosed and unfixed VM bug.
 

2018-05-08 18:36 GMT+03:00 Henrik-Nergaard <[hidden email]>:
Hi,

>Announcer allInstances size. “7124"
Remember that GT implements a lot of Announcer subclasses so to gain a
better picture you should use:
Announcer allSubInstances size.

>clearly, that’s not good.
>a symptom there is something leaking badly in our current development
version.
There has been leaking Announcements back from Pharo 5. Most of them is
tangled into Rubric, and some GT tools.
In the past many of the leaks has been from mixing weak and non weak
subscriptions in the same announcer, IIRC.

Here is a script you can run.

===========================================================
| bag dct |

bag := Bag new.
dct := IdentityDictionary new.

Smalltalk garbageCollect.
Announcer allSubInstancesDo: [ :instance | | subs |
        subs := instance subscriptions subscriptions.
        subs do: [ :each | | cls |
                cls := each announcementClass.
                bag add: cls.
                dct at: cls
                        ifPresent: [ :set | set add: each class ]
                        ifAbsentPut: [ IdentitySet with: each class ]
        ]
].

"{ bag . dct } inspect."

"String streamContents: [ :ss |
        bag sortedCounts do: [ :assoc |
                ss
                        << (assoc key asString padRightTo: 7);
                        << assoc value printString;
                        cr
        ]
]"

dct associations select: [ :assoc | assoc value size > 1 ]

===========================================================

Best regards,
Henrik






--
Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html





--
_,,,^..^,,,_
best, Eliot
Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-dev] fun with announcers

Stephan Eggermont-3
 
Eliot Miranda <[hidden email]> wrote:

> Can you tell me whether this is an application bug or possibly a bug with
> the Spur VMs weak collections?  I'd hate for this to be an undiagnosed and
> unfixed VM bug.

Much more likely an application bug. Copying Morphs that contain Rubric
editors is non-trivial.

Stephan

Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-dev] fun with announcers

Denis Kudriashov
 


2018-05-09 22:18 GMT+03:00 Stephan Eggermont <[hidden email]>:
 
Eliot Miranda <[hidden email]> wrote:

> Can you tell me whether this is an application bug or possibly a bug with
> the Spur VMs weak collections?  I'd hate for this to be an undiagnosed and
> unfixed VM bug.

Much more likely an application bug. Copying Morphs that contain Rubric
editors is non-trivial.

Yes. I am sure it can't be VM issue. 
My candidate for leak is spotter windows history. I remember I detect some leaks when it was integrated in Pharo7. But I was not sure, it was very fast test. And it can be wrong.
 

Stephan


Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-dev] fun with announcers

Pavel Krivanek-3
 
I'm not sure if it a cause of all leaks but I realized that the method  ClyDataSourceUpdateScheduler>>#processQueue that looks like this:

processQueue

| available next |
[
available := OrderedCollection with: updateQueue next.
[ next := updateQueue nextOrNil ] whileNotNil: [ available add: next ].
self runUpdateFor: available.
] repeat

keeps always an indirect pointer to the full Calypso browser window because of the escaping variable (next) of the closure. Moving the temporaries definition to the inner closure fixes the leak.

-- Pavel




2018-05-09 21:44 GMT+02:00 Denis Kudriashov <[hidden email]>:
 


2018-05-09 22:18 GMT+03:00 Stephan Eggermont <[hidden email]>:
 
Eliot Miranda <[hidden email]> wrote:

> Can you tell me whether this is an application bug or possibly a bug with
> the Spur VMs weak collections?  I'd hate for this to be an undiagnosed and
> unfixed VM bug.

Much more likely an application bug. Copying Morphs that contain Rubric
editors is non-trivial.

Yes. I am sure it can't be VM issue. 
My candidate for leak is spotter windows history. I remember I detect some leaks when it was integrated in Pharo7. But I was not sure, it was very fast test. And it can be wrong.
 

Stephan




Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-dev] fun with announcers

Denis Kudriashov
 

2018-05-15 15:56 GMT+03:00 Pavel Krivanek <[hidden email]>:
 
I'm not sure if it a cause of all leaks but I realized that the method  ClyDataSourceUpdateScheduler>>#processQueue that looks like this:

processQueue

| available next |
[
available := OrderedCollection with: updateQueue next.
[ next := updateQueue nextOrNil ] whileNotNil: [ available add: next ].
self runUpdateFor: available.
] repeat

keeps always an indirect pointer to the full Calypso browser window because of the escaping variable (next) of the closure. Moving the temporaries definition to the inner closure fixes the leak.

Interesting.
But I only see that available variable will keep instances from previous iteration, up to next update event.


-- Pavel




2018-05-09 21:44 GMT+02:00 Denis Kudriashov <[hidden email]>:
 


2018-05-09 22:18 GMT+03:00 Stephan Eggermont <[hidden email]>:
 
Eliot Miranda <[hidden email]> wrote:

> Can you tell me whether this is an application bug or possibly a bug with
> the Spur VMs weak collections?  I'd hate for this to be an undiagnosed and
> unfixed VM bug.

Much more likely an application bug. Copying Morphs that contain Rubric
editors is non-trivial.

Yes. I am sure it can't be VM issue. 
My candidate for leak is spotter windows history. I remember I detect some leaks when it was integrated in Pharo7. But I was not sure, it was very fast test. And it can be wrong.
 

Stephan






Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-dev] fun with announcers

Pavel Krivanek-3
In reply to this post by Pavel Krivanek-3
 
small correction, the leaking variable is "available", not "next"


2018-05-15 14:56 GMT+02:00 Pavel Krivanek <[hidden email]>:
I'm not sure if it a cause of all leaks but I realized that the method  ClyDataSourceUpdateScheduler>>#processQueue that looks like this:

processQueue

| available next |
[
available := OrderedCollection with: updateQueue next.
[ next := updateQueue nextOrNil ] whileNotNil: [ available add: next ].
self runUpdateFor: available.
] repeat

keeps always an indirect pointer to the full Calypso browser window because of the escaping variable (next) of the closure. Moving the temporaries definition to the inner closure fixes the leak.

-- Pavel




2018-05-09 21:44 GMT+02:00 Denis Kudriashov <[hidden email]>:
 


2018-05-09 22:18 GMT+03:00 Stephan Eggermont <[hidden email]>:
 
Eliot Miranda <[hidden email]> wrote:

> Can you tell me whether this is an application bug or possibly a bug with
> the Spur VMs weak collections?  I'd hate for this to be an undiagnosed and
> unfixed VM bug.

Much more likely an application bug. Copying Morphs that contain Rubric
editors is non-trivial.

Yes. I am sure it can't be VM issue. 
My candidate for leak is spotter windows history. I remember I detect some leaks when it was integrated in Pharo7. But I was not sure, it was very fast test. And it can be wrong.
 

Stephan





Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-dev] fun with announcers

Denis Kudriashov
 
Ok. I fixed found places in Calypso

2018-05-15 16:06 GMT+03:00 Pavel Krivanek <[hidden email]>:
 
small correction, the leaking variable is "available", not "next"


2018-05-15 14:56 GMT+02:00 Pavel Krivanek <[hidden email]>:
I'm not sure if it a cause of all leaks but I realized that the method  ClyDataSourceUpdateScheduler>>#processQueue that looks like this:

processQueue

| available next |
[
available := OrderedCollection with: updateQueue next.
[ next := updateQueue nextOrNil ] whileNotNil: [ available add: next ].
self runUpdateFor: available.
] repeat

keeps always an indirect pointer to the full Calypso browser window because of the escaping variable (next) of the closure. Moving the temporaries definition to the inner closure fixes the leak.

-- Pavel




2018-05-09 21:44 GMT+02:00 Denis Kudriashov <[hidden email]>:
 


2018-05-09 22:18 GMT+03:00 Stephan Eggermont <[hidden email]>:
 
Eliot Miranda <[hidden email]> wrote:

> Can you tell me whether this is an application bug or possibly a bug with
> the Spur VMs weak collections?  I'd hate for this to be an undiagnosed and
> unfixed VM bug.

Much more likely an application bug. Copying Morphs that contain Rubric
editors is non-trivial.

Yes. I am sure it can't be VM issue. 
My candidate for leak is spotter windows history. I remember I detect some leaks when it was integrated in Pharo7. But I was not sure, it was very fast test. And it can be wrong.
 

Stephan