[Q] Collectin lots of garbage

John M McIntosh johnmci at smalltalkconsulting.com
Wed Oct 1 06:35:44 UTC 2003


On Tuesday, September 30, 2003, at 11:16  PM, Martin Drautzburg wrote:

> The reason I am asking is because I made the following observation:
>
> I compute the amount of garbage in the tree by counting all instances
> of tree nodes and the number of tree nodes that are connected to the
> root. The difference between the two numbers is the garbage. (I *know*
> there are no other references from outside the tree).
>
> When I chop off a branch I can see the amount of garbage increase but
> it remains garbage for at least many minutes (I haven't yet seen it
> go, because I was always too imatient). When I select "space left"
> from the world menu It sometimes returns instantly and sometimes it
> takes about a minute. Then eventually the garbage is collected.

"Space left" should do an incremental GC, and a full GC. But I'll need  
to ask which VM you
are using, and which machine (Mhz & MB of real memory & image size) you  
are running on just so we track this "minute" you refer to.

>
> My feeling is that it is only collected by the "long" "space left"
> runs. So I suspect that incremental garbage collecting will never
> collect this kind of garbage and a full GC takes a long time.
>
> Could that be the case ?

If a link to the tree exists in old space, then incremental GCs won't  
collect the tree because
the roots of the world point to it, even tho those roots are dead. We  
don't know that yet because
we require a Full GC to find that out.

>
> Also saving the image sometimes takes a long time. Is there a full GC
> before the image is saved ?

Creating a snapshot does both an incremental and a full GC.
--
======================================================================== 
===
John M. McIntosh <johnmci at smalltalkconsulting.com> 1-800-477-2659
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
======================================================================== 
===



More information about the Squeak-dev mailing list