[squeak-dev] Shrinking

Colin Putney colin at wiresong.com
Tue Jan 7 00:35:55 UTC 2014


On Mon, Jan 6, 2014 at 4:40 PM, Tobias Pape <Das.Linux at gmx.de> wrote:


> Before trying to shrink, check that there are _not_ the 8 Obsoletes I
> talked about in
> <94EA41C1-42EF-462E-8883-A8999AA7CB03 at gmx.de> (
> http://forum.world.st/Obsoletes-tp4732904p4732931.html)
>

Aha!

In the latest Trunk, there's only 6 obsolete classes, as the recent
Environment changes fixed the two of them. The following script, adapted
from your post above, cleans them up nicely:

" Fix obsolete ColorTheme"
ColorTheme current class isObsolete ifTrue: [
ColorTheme current: nil.
Smalltalk garbageCollect.
ColorTheme current].

" Fix obsolete uncle classes (cls->meta->super)"
(Smalltalk allClasses select: [:cls | cls theMetaClass superclass
isObsolete]
) copy do: [:withObsoleteUncle | | cls2 |
cls2 := withObsoleteUncle addInstVarName:
'veryUnlikelyToExisitAnywhereInTheSystemAsVariableName'.
Smalltalk garbageCollect.
cls2 removeInstVarName:
'veryUnlikelyToExisitAnywhereInTheSystemAsVariableName'.].
Smalltalk garbageCollect.
Smalltalk fixObsoleteReferences.



Running "Smalltalk shrink" then complains about two obsolete behaviours,
and I this is a bug with Installer. If I just close the debugger and
inspector, collect garbage and then run "SystemNavigation default
obsoleteBehaviors" I get an empty array.

So it looks like the shrink works. It doesn't do much, though. My image
goes from 20.9MB, down to 20.3MB.

Colin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20140106/d5cacd05/attachment.htm


More information about the Squeak-dev mailing list