Squeak
  links to this page:    
View this PageEdit this Page (locked)Uploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
Shrinking a 3.4gamma image
Last updated at 4:23 pm UTC on 14 January 2006


Example of shrinkig a 3.4gamma image
Often the image shrinking produces an image that contains obsolete classes.
An obsolete class is the remanant of a removed class. An obsolete class
continues to exist in the image for as long as either
> at least one compiled method references the removed class
or
> at least one instance of the removed class is reachable.

There are two approaches to this problem: One can try to remove
obsolete classes from a shrunken image - this is difficult, but possible -
and one can try to modify the image prior to shinking in such a
way that the shrinking will not leave obsolete classes in the
image. This second approach is to be preferred.

Compiled methods that reference removed classes connot successfully
be recompiled - a recompilation helps to find such methods very
quickly. References to instances of removed classes are much more
difficult to find. It is a good idea to inspect global dictionaries,
pool dictionaries, class variables and class instance variables before
you shrink the image.

During a preparatory step to shrinking one has to modify all methods
that contain references to classes that are to be removed. This
is not an easy task: It requires a lot of patience to disentangle
MVC and Morphic - which is necessary when you want to remove
the Morphic interface.

Here you find a zip-file (size: 64 KBytes) that contains a script that
creates a 1.5 MBytes MVC-only .changes file from a virgin 3.4 #5170 image.
The script does not work for other versions, but for the mentioned
version it produces an image without a single obsolete class.
Missing File (/squeak/uploads/Shrink.zip) (size: 71 KBytes. updated at Nov 08, 2003. An earlier version of the script had a serious flaw: It removed the methods in class Class, that are needed to create variable subclasses. Sorry for that!)
(added by Boris Gaertner)






An example log of shrinking an 3.4 image manually by 2MB.

Example of

Workspace and log


Shrinking a 3.4gamma-5169 .changes file.

"Size at start: 10046kb"
ProjectViewMorph allInstancesDo:
[:m | (m hasProperty: #deleteWorldsOfSqueak) ifTrue:
[Project deletingProject: m project. m delete]].
Project rebuildAllProjects.
ScriptingSystem spaceReclaimed

Smalltalk garbageCollect.

"size is now 9048kB"
"———————"
ChangeSet allInstancesDo: [:cs | cs zapHistory].

"9330kB"
"———————"
"Get change set Baloon3DRemoval.cs from SqueakMap.
FileIn the changeSet."

"size is now 8321kB"
"———————"
"File in change set GamesRemoval-asm.cs"
"size is now 8170kB"
"———————"