<br><font size=2 face="Courier New">Mike Rutenberg wrote:</font>
<br>
<br><font size=2 face="Courier New">&gt;&gt;How do you use Smalltalk majorShrink in any case, </font>
<br><font size=2 face="Courier New">&gt;&gt;since the top project in the standard image is a Morphic?</font>
<br><font size=2 face="Courier New">&gt;&gt;Is there some standard way of making a MVC project the head?<br>
</font>
<br><font size=2 face="sans-serif">This is my proposal to make a MVC project the head:</font>
<br>
<br>
<br><font size=2 face="sans-serif">1. Enter the top Project</font>
<br><font size=2 face="sans-serif">2. Create a new mvc project</font>
<br><font size=2 face="sans-serif">3. enter the mvc project that you created</font>
<br><font size=2 face="sans-serif">4. Open a workspace and execute the following piece of code:</font>
<br>
<br>
<br><font size=2 face="sans-serif">&nbsp; | topProject this toBeDeleted |</font>
<br>
<br><font size=2 face="sans-serif">&nbsp;topProject := Project allProjects</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; detect: [:p | p isTopProject].</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; this := Project current.</font>
<br><font size=2 face="sans-serif">&nbsp; topProject setParent: this.</font>
<br><font size=2 face="sans-serif">&nbsp; this setParent: this.</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &quot; &nbsp;to prepare a major shrink, you may with to delete all other projects: &quot;</font>
<br><font size=2 face="sans-serif">&nbsp; toBeDeleted := Project allProjects reject: [:p | p == this].</font>
<br><font size=2 face="sans-serif">&nbsp; toBeDeleted do: [:p | Project deletingProject: p].</font>
<br>
<br>
<br><font size=2 face="sans-serif">5. Execute &quot;Project allProjects&quot; with &quot;inspect it&quot;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp;You should see one single project.</font>
<br>
<br>
<br>
<br><font size=2 face="sans-serif">Second step: Preparation of a major shrink.</font>
<br>
<br><font size=2 face="sans-serif">To do a major shrink on a computer without a pointing device</font>
<br><font size=2 face="sans-serif">I tried this:</font>
<br>
<br><font size=2 face="sans-serif">1. File in the attached changes set.</font>
<br><font size=2 face="sans-serif">2. Open a workspace an execute the following statement:</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; Smalltalk setStartUpActivity: #majorShrink.</font>
<br>
<br><font size=2 face="sans-serif">3. Open the Transcript</font>
<br><font size=2 face="sans-serif">4. Save the image and exit Smalltalk.</font>
<br><font size=2 face="sans-serif">5. Start Smalltalk again.</font>
<br>
<br>
<br><font size=2 face="sans-serif">A few words about the change set:</font>
<br><font size=2 face="sans-serif">It &nbsp;adds the Class variable StartUpActivity to the class</font>
<br><font size=2 face="sans-serif">SystemDictionary.</font>
<br><font size=2 face="sans-serif">It modifies the instance method snapshot:andQuit:embedded:</font>
<br><font size=2 face="sans-serif">of class SystemDictionary. This is the method that is</font>
<br><font size=2 face="sans-serif">entered when you restart Smalltalk.</font>
<br>
<br><font size=2 face="sans-serif">The following passage is added: </font>
<br>
<br>
<br><font size=2 face="sans-serif">&nbsp; &nbsp;&lt; ... &gt;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;StartUpActivity notNil</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ifTrue: [ | selector |</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; selector := StartUpActivity.</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; StartUpActivity := nil.</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (self respondsTo: selector)</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ifTrue: [self perform: selector]</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;].</font>
<br>
<br><font size=2 face="sans-serif">The value of StartUpActivity is expected to be either nil</font>
<br><font size=2 face="sans-serif">or the name of a message that SystemDictionary understands.</font>
<br>
<br><font size=2 face="sans-serif">This is very simple: When there is a startup activity, it is</font>
<br><font size=2 face="sans-serif">executed at start up. To avoid repeated execution at every</font>
<br><font size=2 face="sans-serif">startup, the variable StartUpActivity is also set to nil.</font>
<br>
<br><font size=2 face="sans-serif">For your convenience, the following instance method</font>
<br><font size=2 face="sans-serif">is added:</font>
<br>
<br>
<br><font size=2 face="sans-serif">setStartUpActivity: aSymbol</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; StartUpActivity := aSymbol</font>
<br>
<br><font size=2 face="sans-serif">*****************************************************</font>
<br>
<br><font size=2 face="sans-serif">My attempts to perform a major shrink with Squeak3.1beta-4478.changes</font>
<br><font size=2 face="sans-serif">revealed a few serious problems: Among other things it was tried to</font>
<br><font size=2 face="sans-serif">remove Class False! Reduction worked better when I added this</font>
<br><font size=2 face="sans-serif">(in method majorShrink):</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; [Smalltalk removeAllUnSentMessages &gt; 0]</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp;whileTrue:</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[Smalltalk unusedClasses do:</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[:c | &nbsp;(#(#False #True #Week </font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;#ReadOnlyVariableBinding</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;#UndefinedObject)</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;includes: c)</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ifFalse: [(Smalltalk at: c) removeFromSystem]].</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; ].</font>
<br>
<br>
<br><font size=2 face="sans-serif">The next attempt revealed that method removal loops for ever:</font>
<br><font size=2 face="sans-serif">The last 38 method to be removed are retrieved again and again.</font>
<br>
<br><font size=2 face="sans-serif">To overcome this I changed the Smalltalk removeAllUnSentMessages &gt; 0</font>
<br><font size=2 face="sans-serif">to Smalltalk removeAllUnSentMessages &gt; 38 and could finally create a</font>
<br><font size=2 face="sans-serif">1.9 MBytes image with 721 classes. The image size is twice the sice of</font>
<br><font size=2 face="sans-serif">a reduced image of Squeak 2.7. The new image contains a lot of obsolete</font>
<br><font size=2 face="sans-serif">classes (more than 200!) That is really a surprise</font>
<br>
<br>
<br><font size=2 face="sans-serif">When started, that image ran into an error: The message</font>
<br><font size=2 face="sans-serif">fetchExternalSettingsIn: was sent to the removed class</font>
<br><font size=2 face="sans-serif">ServerDirectory.</font>
<br><font size=2 face="sans-serif">That error happened in ExternalSettings&gt;&gt;startUp.</font>
<br><font size=2 face="sans-serif">One should perhaps simply remove that call of fetchExternalSettingsIn:.</font>
<br>
<br>
<br>
<br><font size=2 face="sans-serif">A lot of other activities caused errors, too:</font>
<br><font size=2 face="sans-serif">*Open an mvc projects (there are no projects in a reduced image)</font>
<br><font size=2 face="sans-serif">*Selecting &quot;browse hierarchy&quot; from a class hierarchy browser</font>
<br><font size=2 face="sans-serif">&nbsp; (class HierarchyBrowser was removed, but Browser&gt;&gt;spawnHierarchy</font>
<br><font size=2 face="sans-serif">&nbsp; has a reference to it.).</font>
<br>
<br><font size=2 face="sans-serif">I think these problems are well-known, but if you really want to</font>
<br><font size=2 face="sans-serif">perform a major shrink, you will have to solve a few problems</font>
<br><font size=2 face="sans-serif">first.</font>
<br>
<br><font size=2 face="sans-serif">Cheers Boris</font>
<br>
<br>
<br>
<br>
<br>