is there a way to know when a GC is happening?

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

is there a way to know when a GC is happening?

Stéphane Ducasse
Hi 

I would to be able to see when an incremental GC is happening.
is there a way to know when a GC is happening?

S. 
--------------------------------------------
Stéphane Ducasse
03 59 35 87 52
Assistant: Aurore Dalle 
FAX 03 59 57 78 50
TEL 03 59 35 86 16
S. Ducasse - Inria
40, avenue Halley, 
Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
Villeneuve d'Ascq 59650
France

Reply | Threaded
Open this post in threaded view
|

Re: is there a way to know when a GC is happening?

Esteban A. Maringolo
On Wed, Sep 9, 2020 at 11:58 PM Eliot Miranda <[hidden email]> wrote:

> In VisualWorks, for example, a WeakArray is primed with an Object instance, and this gets collected every scavenge.
> So the WeakArray is notified.  From this VW builds a notification system.

I guess this is how VisualWorks changes its cursor from a regular
pointer to the, sometimes dreadful, "GC" icon during garbage
collection.
Isn't it?

Regards!

Esteban A. Maringolo

Reply | Threaded
Open this post in threaded view
|

Re: is there a way to know when a GC is happening?

Eliot Miranda-2


On Wed, Sep 9, 2020 at 9:49 PM Esteban Maringolo <[hidden email]> wrote:
On Wed, Sep 9, 2020 at 11:58 PM Eliot Miranda <[hidden email]> wrote:

> In VisualWorks, for example, a WeakArray is primed with an Object instance, and this gets collected every scavenge.
> So the WeakArray is notified.  From this VW builds a notification system.

I guess this is how VisualWorks changes its cursor from a regular
pointer to the, sometimes dreadful, "GC" icon during garbage
collection.
Isn't it?

I think so :-)
 

Regards!

Esteban A. Maringolo

and to you, Esteban! 

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

Re: is there a way to know when a GC is happening?

Martin McClure-2
In reply to this post by Esteban A. Maringolo
On 9/9/20 8:43 PM, Esteban Maringolo wrote:
> On Wed, Sep 9, 2020 at 11:58 PM Eliot Miranda <[hidden email]> wrote:
>
>> In VisualWorks, for example, a WeakArray is primed with an Object instance, and this gets collected every scavenge.
>> So the WeakArray is notified.  From this VW builds a notification system.
> I guess this is how VisualWorks changes its cursor from a regular
> pointer to the, sometimes dreadful, "GC" icon during garbage
> collection.
> Isn't it?
>
No, that wouldn't work. Notification based on a weak array can only
notify after the scavenge (or other GC) has happened, at which point
it's too late to put up the GC cursor.

And a weak array doesn't seem like it could be reliable for notification
of scavenge -- what if the Object in the weak array gets tenured? Then
only an incremental or full GC could collect it and notify. Scavenge
notification is done by the VM signaling a semaphore that a scavenge
notification thread is waiting on.

And the GC cursor is simple -- it's explicitly set by Smalltalk code
before a compacting GC, and set back afterward.

Regards,
-Martin

Reply | Threaded
Open this post in threaded view
|

Re: is there a way to know when a GC is happening?

Davide Grandi-3
In reply to this post by Stéphane Ducasse

If Pharo's gc algorithm is concurrent => maybe yes,
otherwise surely no : if I'm not wrong gc starts inside VM
when checking allocation spaces during a basicNew or alike.
And the VM seems stuck, at that moment.

One can try to create an ephemeron and check it every 100-500 ms,
refreshing it if it's still here (so it will stay in new space).
But it shift the question to the definitive target group :
the VM guys !!!

Chers from Lombardy,
    Davide
(PS : but creating the ephemeron could start an invisible gc !!!)

On 09/09/2020 13:38, Stéphane Ducasse wrote:
Hi 

I would to be able to see when an incremental GC is happening.
is there a way to know when a GC is happening?

S. 
--------------------------------------------
Stéphane Ducasse
03 59 35 87 52
Assistant: Aurore Dalle 
FAX 03 59 57 78 50
TEL 03 59 35 86 16
S. Ducasse - Inria
40, avenue Halley, 
Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
Villeneuve d'Ascq 59650
France

-- 
Ing. Davide Grandi
email    : [hidden email]
mobile   : +39 339 7468 778
linkedin : http://linkedin.com/in/davidegrandi
Reply | Threaded
Open this post in threaded view
|

Re: is there a way to know when a GC is happening?

Aliaksei Syrel
In reply to this post by Stéphane Ducasse
Hi

I wish there was a way to control *when* full GC is allowed to happen. For example, I would prefer GC to occur while the UI rendering loop is paused and not in the middle of the frame resulting in sometimes sluggish animations in the case of large images.

Thank you

On Wed, 9 Sep 2020 at 14:39, Stéphane Ducasse <[hidden email]> wrote:
Hi 

I would to be able to see when an incremental GC is happening.
is there a way to know when a GC is happening?

S. 


--------------------------------------------
Stéphane Ducasse
03 59 35 87 52
Assistant: Aurore Dalle 
FAX 03 59 57 78 50
TEL 03 59 35 86 16
S. Ducasse - Inria
Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
Villeneuve d'Ascq 59650
France







--
Cheers,
Alex
Reply | Threaded
Open this post in threaded view
|

Re: is there a way to know when a GC is happening?

Davide Grandi-3

Maybe it's undecidable.
Now it happens when a memory space is full, and I
think that memory spaces aren't dynamically configurable.

    Davide

On 10/09/2020 10:41, Aliaksei Syrel wrote:
Hi

I wish there was a way to control *when* full GC is allowed to happen. For example, I would prefer GC to occur while the UI rendering loop is paused and not in the middle of the frame resulting in sometimes sluggish animations in the case of large images.

Thank you

On Wed, 9 Sep 2020 at 14:39, Stéphane Ducasse <[hidden email]> wrote:
Hi 

I would to be able to see when an incremental GC is happening.
is there a way to know when a GC is happening?

S. 

--------------------------------------------
Stéphane Ducasse
03 59 35 87 52
Assistant: Aurore Dalle 
FAX 03 59 57 78 50
TEL 03 59 35 86 16
S. Ducasse - Inria
Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
Villeneuve d'Ascq 59650
France

--
Cheers,
Alex
-- 
Ing. Davide Grandi
email    : [hidden email]
mobile   : +39 339 7468 778
linkedin : http://linkedin.com/in/davidegrandi
Reply | Threaded
Open this post in threaded view
|

Re: is there a way to know when a GC is happening?

Martin McClure-2
In reply to this post by Aliaksei Syrel
Hi Aliaksei,

In VW, scavenges are done automatically by the VM, but all heavier-weight GC is controlled by the image, through a MemoryPolicy object. In the GemStone client for VW we provide a memory policy that discourages GC during times when our mapping dictionaries are strong, deferring it to just after we make the dictionaries weak so the GC can actually collect things that are mapped but no longer used.

It sounds like you'd like something very much like this, to tend to defer GC to a good point in the rendering cycle. And "tend to" is important -- when space is getting *really* low, it's a good idea to go ahead and do the GC regardless of whether it's a "good" time.

Regards,
-Martin

On 9/10/20 1:41 AM, Aliaksei Syrel wrote:
Hi

I wish there was a way to control *when* full GC is allowed to happen. For example, I would prefer GC to occur while the UI rendering loop is paused and not in the middle of the frame resulting in sometimes sluggish animations in the case of large images.

Thank you

On Wed, 9 Sep 2020 at 14:39, Stéphane Ducasse <[hidden email]> wrote:
Hi 

I would to be able to see when an incremental GC is happening.
is there a way to know when a GC is happening?

S. 


--------------------------------------------
Stéphane Ducasse
03 59 35 87 52
Assistant: Aurore Dalle 
FAX 03 59 57 78 50
TEL 03 59 35 86 16
S. Ducasse - Inria
Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
Villeneuve d'Ascq 59650
France







--
Cheers,
Alex