<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<font face="Georgia">Perhaps in neat and tidy situations, but I
invite your comments on<br>
<br>
test1<br>
"<br>
ThreeGCTest test1<br>
"<br>
| object registry other say |<br>
<br>
Smalltalk garbageCollect.<br>
Transcript cr.<br>
say _ [ :str |<br>
Transcript show: Smalltalk garbageCollect
asStringWithCommas,' ',str; cr<br>
].<br>
say value: 'start'.<br>
registry := WeakRegistry new.<br>
object := Object new.<br>
other _ String new: 1024*102*16.<br>
registry add: object executor: (ObjectFinalizer<br>
receiver: [other _ nil]<br>
selector: #value).<br>
say value: 'created'.<br>
object := nil. <br>
say value: 'gc1'.<br>
say value: 'gc2'.<br>
say value: 'gc3'.<br>
<br>
which produces:<br>
<br>
505,963,044 start<br>
504,291,464 created<br>
504,291,360 gc1<br>
505,962,536 gc2<br>
505,962,428 gc3<br>
<br>
Cheers,<br>
Bob<br>
<br>
</font>
<div class="moz-cite-prefix">On 1/21/13 3:28 PM, Bert Freudenberg
wrote:<br>
</div>
<blockquote
cite="mid:9C005D24-66A9-4752-A6D3-BDDBB97DB275@freudenbergs.de"
type="cite">
<pre wrap="">On 21.01.2013, at 14:05, <a class="moz-txt-link-abbreviated" href="mailto:commits@source.squeak.org">commits@source.squeak.org</a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">3 timesRepeat: [ Smalltalk garbageCollect].
</pre>
</blockquote>
<pre wrap="">
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 -
</pre>
</blockquote>
<br>
</body>
</html>