[squeak-dev] The Inbox: System-edc.512.mcz

Bert Freudenberg bert at freudenbergs.de
Mon Jan 21 23:27:49 UTC 2013


On 21.01.2013, at 15:05, Bob Arning <arning315 at comcast.net> wrote:

> Perhaps in neat and tidy situations, but I invite your comments on

The situation at hand was having to do with MCDefinitions in a WeakSet. Since MCDefinitions don't have finalizers, it won't make any difference. Of course it's possible to construct a chain of finalizers where even 3 GCs would not be enough.

- Bert -


> 
> test1
> "
> ThreeGCTest test1
> "
>     | object registry other say |
>     
>     Smalltalk garbageCollect.
>     Transcript cr.
>     say _ [ :str |
>         Transcript show: Smalltalk garbageCollect asStringWithCommas,' ',str; cr
>     ].
>     say value: 'start'.
>     registry := WeakRegistry new.
>     object := Object new.
>     other _ String new: 1024*102*16.
>     registry add: object executor: (ObjectFinalizer
>         receiver: [other _ nil]
>         selector: #value).
>     say value: 'created'.
>     object := nil. 
>     say value: 'gc1'.
>     say value: 'gc2'.
>     say value: 'gc3'.
> 
> which produces:
> 
> 505,963,044 start
> 504,291,464 created
> 504,291,360 gc1
> 505,962,536 gc2
> 505,962,428 gc3
> 
> Cheers,
> Bob
> 
> On 1/21/13 3:28 PM, Bert Freudenberg wrote:
>> On 21.01.2013, at 14:05, commits at source.squeak.org wrote:
>> 
>>> 3 timesRepeat: [ Smalltalk garbageCollect].
>> Doing this 3 times is superstitious. It won't clean up more than doing it once.
>> 
>> IMHO an explicit GC is not necessary at all - what purpose does it serve?
>> 
>> - Bert -
>> 
>> 
>> 
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20130121/5b710126/attachment.htm


More information about the Squeak-dev mailing list