<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi all,<div class=""><br class=""></div><div class="">I am new to the list, so I couldn’t answer directly to Minifying Woes (or at least didn’t know how to).</div><div class=""><br class=""></div><div class="">I identified 75 VM intern objects in Tom’s (tobe) image, by loading it in the simulator and setting a halt after loading the image.</div><div class="">With the following code:</div><div class=""><div class=""><br class=""></div><div class="">| collection |</div><div class=""><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">collection</span> := OrderedCollection new.</div><div class="">self allOldSpaceEntitiesDo: [:obj | (((self classIndexOf: obj) < self lastClassIndexPun) and: (self isImmediate: obj) not) ifTrue: [ <span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">collection</span> add: obj] ].</div><div class="">(<span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">collection</span> sorted: [:a :b | (self bytesInBody: a) > (self bytesInBody: b)]) collect: [:ea | ea hex -> (self bytesInBody: ea)]</div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">I get the following 75 objects:</div><div class=""><br class=""></div><div class="">1. A free chunk after all other objects. Can be ignored for the sake of minimising image size<br class="">2. Remembered set -> 1048592 byte<br class="">3. hiddenRootsObj  -> 32848 byte<br class="">4 - 61. Pages of the mark and weakling stack -> respectively 32752 byte<br class="">62 - 74. arrays of the class table -> <span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">respectively</span> 8208 byte<br class="">75. specialObjectsOop -> 520 byte</div><div class=""><br class=""></div><div class="">As far as I can judge the stack pages and remembered set could be removed from the image to minimize it further.</div><div class="">If I understand correctly the StackPages could be removed by using the SpurImagePreener. The remembered set </div><div class="">Could be removed in the <font color="#000000" class="">SpurImagePreener too (when the VM initialises the memory it initialises a new remembered set too, if it is nil).</font></div><div class=""><font color="#000000" class="">After a quick read of the <span style="caret-color: rgb(0, 0, 0);" class="">SpurImagePreener I didn’t see that the remembered set gets removed.</span></font></div><div class=""><font color="#000000" class=""><span style="caret-color: rgb(0, 0, 0);" class=""><br class=""></span></font></div><div class=""><font color="#000000" class="">When I tried using the preener it resulted in an unusable image (both simulator and compiled VM couldn’t load it).</font></div><div class=""><font color="#000000" class="">I tried both:</font></div><div class=""><font color="#000000" class=""><br class=""></font></div><div class=""><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">SpurImagePreener new </span></div><div class=""><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class=""><span class="Apple-tab-span" style="white-space:pre">     </span>preenImage: '/Users/tombraun/Desktop/Squeak6.0-22104-64bit copy.image'</span></div><div class=""><font color="#000000" class=""><br class=""></font></div><div class=""><font color="#000000" class=""><div class="">SpurImagePreener new </div><div class=""><span class="Apple-tab-span" style="white-space:pre">       </span>writeDefaultHeader: true;</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>savedWindowSize: 1@1;</div><div class=""><span class="Apple-tab-span" style="white-space:pre">     </span>preenImage: '/Users/tombraun/Desktop/Squeak6.0-22104-64bit copy.image'</div></font></div><div class=""><font color="#000000" class=""><br class=""></font></div><div class=""><font color="#000000" class="">Could be a me problem, as I did some changes to the memory management in my VMMaker image, although this shouldn’t influence </font></div><div class=""><font color="#000000" class="">the preener….</font></div><div class=""><font color="#000000" class=""><span style="caret-color: rgb(0, 0, 0);" class=""><br class=""></span></font></div><div class=""><font color="#000000" class=""><span style="caret-color: rgb(0, 0, 0);" class=""><br class=""></span></font></div><div class=""><font color="#000000" class=""><span style="caret-color: rgb(0, 0, 0);" class="">On this note @Eliot: why the decision to make the object stacks and the remembered set VM managed objects instead of allocating them </span></font></div><div class=""><font color="#000000" class="">separately? </font></div><div class=""><font color="#000000" class="">1. We don’t need to keep them in a snapshot. All object stacks are empty after GC and as we flushed the new space pre snapshot</font></div><div class=""><font color="#000000" class="">The remembered set shouldn't need to be persisted too. </font></div><div class=""><font color="#000000" class="">2. During GC we simply mark all stack pages and keep them alive. When we at least </font></div><div class=""><font color="#000000" class="">freed empty pages (after a limit, to prevent the running VM from having to allocate too many pages every GC?) I would see the value.</font></div><div class=""><font color="#000000" class=""><br class=""></font></div><div class=""><font color="#000000" class="">What did I overlook or does it simply have historical reasons?</font></div><div class=""><font color="#000000" class=""><span style="caret-color: rgb(0, 0, 0);" class=""><br class=""></span></font></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Best,</div><div class="">Tom (WoC)</div><div class=""><br class=""></div><div class=""><br class=""></div></body></html>