<div dir="ltr">Hi Tty,<div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Feb 14, 2014 at 8:31 AM, gettimothy <span dir="ltr">&lt;<a href="mailto:gettimothy@zoho.com" target="_blank">gettimothy@zoho.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> <br><u></u><div><div style="font-size:10pt;font-family:Verdana,Arial,Helvetica,sans-serif">The notes at Eliot&#39;s blog here: <a href="http://www.squeakvm.org/svn/squeak/branches/Cog/image/Workspace.text" target="_blank">http://www.squeakvm.org/svn/squeak/branches/Cog/image/Workspace.text</a><br>
imply the difference is important when building a Cog Development Image.<br><br><pre>i.e.<br><blockquote style="border:1px solid rgb(204,204,204);padding:7px;background-color:rgb(245,245,245)"><div>N.B. do *not* load VMMaker or VMMaker-oscog. N.B. VMMaker.oscog packages may be listed with VMMaker packages depending on Monticello version.</div>
</blockquote> <br>I don&#39;t know the implied difference.<br></pre></div></div></blockquote><div><br></div><div>VMMaker is the trunk Interpreter VM.  It doesn&#39;t contain Cog.</div><div>VMMaker-oscog is an old misnamed line of versions.</div>
<div>VMMaker.oscog is my Cog branch.  Pharo has their own branch from this.  </div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-size:10pt;font-family:Verdana,Arial,Helvetica,sans-serif">
<pre>cheers<br><br>tty<br></pre><br><div><br>---- On Fri, 14 Feb 2014 08:03:00 -0800 <b>Levente Uzonyi&lt;<a href="mailto:leves@elte.hu" target="_blank">leves@elte.hu</a>&gt;</b> wrote ---- <br></div><br><blockquote style="border-left:1px solid #0000ff;padding-left:6px;margin:0 0 0 5px">
  <br>Is it intentional that this package and the previous one are prefixed with  <br>dots? <br> <br> <br>Levente <br> <br>On Thu, 13 Feb 2014, <a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a> wrote: <br>
 <br>&gt; <br>&gt; Eliot Miranda uploaded a new version of VMMaker to project VM Maker: <br>&gt; <a href="http://source.squeak.org/VMMaker/..VMMaker.oscog-eem.618.mcz" target="_blank">http://source.squeak.org/VMMaker/..VMMaker.oscog-eem.618.mcz</a> <br>
&gt; <br>&gt; ==================== Summary ==================== <br>&gt; <br>&gt; Name: ..VMMaker.oscog-eem.618 <br>&gt; Author: eem <br>&gt; Time: 13 February 2014, 11:51:10.104 am <br>&gt; UUID: 3756532a-fdbf-4e96-8cc9-be0f35157864 <br>
&gt; Ancestors: ..VMMaker.oscog-eem.617 <br>&gt; <br>&gt; Some musings on Spur compaction. <br>&gt; <br>&gt; =============== Diff against ..VMMaker.oscog-eem.617 =============== <br>&gt; <br>&gt; Item was added: <br>&gt; + ----- Method: SpurMemoryManager&gt;&gt;abstractCompaction (in category &#39;compaction - analysis&#39;) ----- <br>
&gt; + abstractCompaction <br>&gt; +     &quot;This method answers a rough estimate of compactibility.&quot; <br>&gt; +     &lt;doNotGenerate&gt; <br>&gt; +     | lowestFree freeChunks used movable | <br>&gt; +     lowestFree := SmallInteger maxVal. <br>
&gt; +     freeChunks := Set new. <br>&gt; +     used := Set new. <br>&gt; +     movable := Set new. <br>&gt; +     self allObjectsInFreeTreeDo: <br>&gt; +         [:f| <br>&gt; +         (self addressAfter: f) &lt; endOfMemory ifTrue: <br>
&gt; +             [freeChunks add: f. <br>&gt; +              f &lt; lowestFree ifTrue: [lowestFree := f]]]. <br>&gt; +     self allOldSpaceObjectsFrom: lowestFree do: <br>&gt; +         [:o| | size delta best | <br>&gt; +         size := self bytesInObject: o. <br>
&gt; +         delta := SmallInteger maxVal. <br>&gt; +         freeChunks do: [:f| | fs | <br>&gt; +             ((fs := self bytesInObject: f) &gt;= size) ifTrue: <br>&gt; +                 [delta &gt; (fs - size) ifTrue: <br>
&gt; +                     [delta := fs - size. best := f]]]. <br>&gt; +          best ifNotNil: <br>&gt; +             [movable add: o. <br>&gt; +              used add: (freeChunks remove: best)]]. <br>&gt; +     ^{ totalFreeOldSpace. movable inject: 0 into: [:s :o| s + (self bytesInObject: o)]. used inject: 0 into: [:s :o| s + (self bytesInObject: o)] }! <br>
&gt; <br>&gt; Item was added: <br>&gt; + ----- Method: SpurMemoryManager&gt;&gt;abstractPigCompaction (in category &#39;compaction - analysis&#39;) ----- <br>&gt; + abstractPigCompaction <br>&gt; +     &quot;This method answers a rough estimate of compactibility using a pig (a large free chunk).&quot; <br>
&gt; +     &lt;doNotGenerate&gt; <br>&gt; +     | pig pork moved unmoved nmoved nunmoved | <br>&gt; +     pig := self findAPig. <br>&gt; +     pork := self bytesInObject: pig. <br>&gt; +     moved := unmoved := nmoved := nunmoved := 0. <br>
&gt; +     self allOldSpaceObjectsFrom: pig do: <br>&gt; +         [:o| | bytes | <br>&gt; +         bytes := self bytesInObject: o. <br>&gt; +         bytes &lt;= pork <br>&gt; +             ifTrue: <br>&gt; +                 [moved := moved + bytes. <br>
&gt; +                  nmoved := nmoved + 1. <br>&gt; +                  pork := pork - bytes] <br>&gt; +             ifFalse: <br>&gt; +                 [unmoved := unmoved + bytes. <br>&gt; +                  nunmoved := nunmoved + 1]]. <br>
&gt; +     ^{ self bytesInObject: pig. pork. moved. nmoved. unmoved. nunmoved }! <br>&gt; <br>&gt; Item was added: <br>&gt; + ----- Method: SpurMemoryManager&gt;&gt;biggies (in category &#39;compaction - analysis&#39;) ----- <br>
&gt; + biggies <br>&gt; +     &quot;This method answers a sorted collection of the objects &gt;= 1,000,000 bytes long, <br>&gt; +      above the lowest large free chunk, sandwiched between nilObj and the end of memory.&quot; <br>
&gt; +     &lt;doNotGenerate&gt; <br>&gt; +     | lowestFree biggies | <br>&gt; +     lowestFree := SmallInteger maxVal. <br>&gt; +     self allObjectsInFreeTreeDo: <br>&gt; +         [:f| (self addressAfter: f) &lt; endOfMemory ifTrue: [f &lt; lowestFree ifTrue: [lowestFree := f]]]. <br>
&gt; +     biggies := SortedCollection new. <br>&gt; +     self allOldSpaceObjectsFrom: lowestFree do: <br>&gt; +         [:f| <br>&gt; +         (self bytesInObject: f) &gt;= 1000000 ifTrue: <br>&gt; +             [biggies add: f]]. <br>
&gt; +     ^{{nilObj hex. #nil}}, (biggies collect: [:f| {f hex. self bytesInObject: f}]), {{endOfMemory hex. #endOfMemory}}! <br>&gt; <br>&gt; Item was added: <br>&gt; + ----- Method: SpurMemoryManager&gt;&gt;compactionIssues (in category &#39;compaction - analysis&#39;) ----- <br>
&gt; + compactionIssues <br>&gt; +     &lt;doNotGenerate&gt; <br>&gt; +     &quot;Compaction isn&#39;t working well.  It rarely moves more than a few tens of kilobytes.  Why? <br>&gt; +      Load an image and before you run it, or just before a GC, run these anaylsis routines. <br>
&gt; +      e.g. <br>&gt; +         self abstractCompaction #(63230272 75456 63210648) <br>&gt; +      shows we can move 75456 bytes of objects, but that would use 63210648 of free space. <br>&gt; +      i.e. there are lots of big free chunks in play, not many small ones that fit the bill. <br>
&gt; + <br>&gt; +         self largeFreeChunkDistribution <br>&gt; +             #(    #(&#39;16r31C788&#39; #nil) <br>&gt; +                 #(&#39;16r1423AC0&#39; 2061864) <br>&gt; +                 #(&#39;16r1B705E8&#39; 1515200) <br>
&gt; +                 #(&#39;16r1D31D20&#39; 2011152) <br>&gt; +                 #(&#39;16r1F37818&#39; 1491480) <br>&gt; +                 #(&#39;16r2225968&#39; 1450512) <br>&gt; +                 #(&#39;16r24C92C8&#39; 48575672)  (16r24C92C8 + 48575672) hex &#39;16r531C780&#39; a free chunk <br>
&gt; +                 #(&#39;16r531C788&#39; #endOfMemory)) <br>&gt; +      shows there&#39;s plenty of large free chunks.  And the trailing 16-byte free chunk shows coallescing is not working properly. <br>&gt; + <br>&gt; +         self biggies #(#(&#39;16r31C788&#39; #nil) #(&#39;16r531C788&#39; #endOfMemory)) <br>
&gt; +      shows there are no large objects to be moved. <br>&gt; + <br>&gt; +      So... looks like compaction should hold onto the lowest large chunk and preferentially move objects into that. <br>&gt; +      Let&#39;s call it a pig.  Compaction needs to whittle away at the pig. <br>
&gt; + <br>&gt; +      e.g. <br>&gt; +         self abstractPigCompaction #(2061864 0 2061864 18759 2018224 34757) <br>&gt; +      shows we can move 18759 objects that will occupy 2018224 bytes into that <br>&gt; +      low pig of 2061864 bytes.&quot;! <br>
&gt; <br>&gt; Item was added: <br>&gt; + ----- Method: SpurMemoryManager&gt;&gt;findAPig (in category &#39;compaction - analysis&#39;) ----- <br>&gt; + findAPig <br>&gt; +     &quot;Answer a large low free chuink.&quot; <br>
&gt; +     &lt;doNotGenerate&gt; <br>&gt; +     | pig | <br>&gt; +     self allObjectsInFreeTreeDo: <br>&gt; +         [:f| <br>&gt; +         (self bytesInObject: f) &gt;= 1000000 ifTrue: <br>&gt; +             [(pig isNil or: [pig &gt; f]) ifTrue: <br>
&gt; +                 [pig := f]]]. <br>&gt; +     ^pig! <br>&gt; <br>&gt; Item was added: <br>&gt; + ----- Method: SpurMemoryManager&gt;&gt;largeFreeChunkDistribution (in category &#39;compaction - analysis&#39;) ----- <br>
&gt; + largeFreeChunkDistribution <br>&gt; +     &quot;This method answers a sorted collection of the free chunks &gt;= 1,000,000 bytes long, <br>&gt; +      sandwiched between nilObj and the end of memory (ignoring the large chunk often found at the end of the heap).&quot; <br>
&gt; +     &lt;doNotGenerate&gt; <br>&gt; +     | freeChunks | <br>&gt; +     freeChunks := SortedCollection new. <br>&gt; +     self allObjectsInFreeTreeDo: <br>&gt; +         [:f| <br>&gt; +         ((self addressAfter: f) &lt; endOfMemory <br>
&gt; +          and: [(self bytesInObject: f) &gt;= 1000000]) ifTrue: <br>&gt; +             [freeChunks add: f]]. <br>&gt; +     ^{{nilObj hex. #nil}}, (freeChunks collect: [:f| {f hex. self bytesInObject: f}]), {{endOfMemory hex. #endOfMemory}}! <br>
&gt; <br>&gt; <br></blockquote><br></div></div><br></blockquote></div><br><br clear="all"><div><br></div>-- <br>best,<div>Eliot</div>
</div></div>