<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On 14 Feb 2014, at 23:28, Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><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: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; position: static; z-index: auto;">&nbsp;<br><u></u><div><div style="font-size:10pt;font-family:Verdana,Arial,Helvetica,sans-serif">The notes at Eliot'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't know the implied difference.<br></pre></div></div></blockquote><div><br></div></div></div></div></blockquote><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>VMMaker is the trunk Interpreter VM. &nbsp;It doesn't contain Cog.</div><div>VMMaker-oscog is an old misnamed line of versions.</div></div></div></div></blockquote><div><br></div><div>well, not completely, this one is the branch we (pharo) are using… keeping it in track (as much as possible) with VMMaker.oscog</div><div><br></div><div>Esteban</div><br><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">
<div>VMMaker.oscog is my Cog branch. &nbsp;Pharo has their own branch from this. &nbsp;</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 'compaction - analysis') ----- <br>
&gt; + abstractCompaction <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;"This method answers a rough estimate of compactibility." <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;&lt;doNotGenerate&gt; <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;| lowestFree freeChunks used movable | <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;lowestFree := SmallInteger maxVal. <br>
&gt; + &nbsp;&nbsp;&nbsp;&nbsp;freeChunks := Set new. <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;used := Set new. <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;movable := Set new. <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;self allObjectsInFreeTreeDo: <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[:f| <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(self addressAfter: f) &lt; endOfMemory ifTrue: <br>
&gt; + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[freeChunks add: f. <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; f &lt; lowestFree ifTrue: [lowestFree := f]]]. <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;self allOldSpaceObjectsFrom: lowestFree do: <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[:o| | size delta best | <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;size := self bytesInObject: o. <br>
&gt; + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;delta := SmallInteger maxVal. <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;freeChunks do: [:f| | fs | <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;((fs := self bytesInObject: f) &gt;= size) ifTrue: <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[delta &gt; (fs - size) ifTrue: <br>
&gt; + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[delta := fs - size. best := f]]]. <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; best ifNotNil: <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[movable add: o. <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; used add: (freeChunks remove: best)]]. <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;^{ 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 'compaction - analysis') ----- <br>&gt; + abstractPigCompaction <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;"This method answers a rough estimate of compactibility using a pig (a large free chunk)." <br>
&gt; + &nbsp;&nbsp;&nbsp;&nbsp;&lt;doNotGenerate&gt; <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;| pig pork moved unmoved nmoved nunmoved | <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;pig := self findAPig. <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;pork := self bytesInObject: pig. <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;moved := unmoved := nmoved := nunmoved := 0. <br>
&gt; + &nbsp;&nbsp;&nbsp;&nbsp;self allOldSpaceObjectsFrom: pig do: <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[:o| | bytes | <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bytes := self bytesInObject: o. <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bytes &lt;= pork <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ifTrue: <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[moved := moved + bytes. <br>
&gt; + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nmoved := nmoved + 1. <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pork := pork - bytes] <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ifFalse: <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[unmoved := unmoved + bytes. <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nunmoved := nunmoved + 1]]. <br>
&gt; + &nbsp;&nbsp;&nbsp;&nbsp;^{ self bytesInObject: pig. pork. moved. nmoved. unmoved. nunmoved }! <br>&gt; <br>&gt; Item was added: <br>&gt; + ----- Method: SpurMemoryManager&gt;&gt;biggies (in category 'compaction - analysis') ----- <br>
&gt; + biggies <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;"This method answers a sorted collection of the objects &gt;= 1,000,000 bytes long, <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp; above the lowest large free chunk, sandwiched between nilObj and the end of memory." <br>
&gt; + &nbsp;&nbsp;&nbsp;&nbsp;&lt;doNotGenerate&gt; <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;| lowestFree biggies | <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;lowestFree := SmallInteger maxVal. <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;self allObjectsInFreeTreeDo: <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[:f| (self addressAfter: f) &lt; endOfMemory ifTrue: [f &lt; lowestFree ifTrue: [lowestFree := f]]]. <br>
&gt; + &nbsp;&nbsp;&nbsp;&nbsp;biggies := SortedCollection new. <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;self allOldSpaceObjectsFrom: lowestFree do: <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[:f| <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(self bytesInObject: f) &gt;= 1000000 ifTrue: <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[biggies add: f]]. <br>
&gt; + &nbsp;&nbsp;&nbsp;&nbsp;^{{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 'compaction - analysis') ----- <br>
&gt; + compactionIssues <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;&lt;doNotGenerate&gt; <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;"Compaction isn't working well.  It rarely moves more than a few tens of kilobytes.  Why? <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp; Load an image and before you run it, or just before a GC, run these anaylsis routines. <br>
&gt; + &nbsp;&nbsp;&nbsp;&nbsp; e.g. <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self abstractCompaction #(63230272 75456 63210648) <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp; shows we can move 75456 bytes of objects, but that would use 63210648 of free space. <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp; i.e. there are lots of big free chunks in play, not many small ones that fit the bill. <br>
&gt; + <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self largeFreeChunkDistribution <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#(&nbsp;&nbsp;&nbsp;&nbsp;#('16r31C788' #nil) <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#('16r1423AC0' 2061864) <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#('16r1B705E8' 1515200) <br>
&gt; + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#('16r1D31D20' 2011152) <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#('16r1F37818' 1491480) <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#('16r2225968' 1450512) <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#('16r24C92C8' 48575672)  (16r24C92C8 + 48575672) hex '16r531C780' a free chunk <br>
&gt; + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#('16r531C788' #endOfMemory)) <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp; shows there's plenty of large free chunks.  And the trailing 16-byte free chunk shows coallescing is not working properly. <br>&gt; + <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self biggies #(#('16r31C788' #nil) #('16r531C788' #endOfMemory)) <br>
&gt; + &nbsp;&nbsp;&nbsp;&nbsp; shows there are no large objects to be moved. <br>&gt; + <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp; So... looks like compaction should hold onto the lowest large chunk and preferentially move objects into that. <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp; Let's call it a pig.  Compaction needs to whittle away at the pig. <br>
&gt; + <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp; e.g. <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self abstractPigCompaction #(2061864 0 2061864 18759 2018224 34757) <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp; shows we can move 18759 objects that will occupy 2018224 bytes into that <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp; low pig of 2061864 bytes."! <br>
&gt; <br>&gt; Item was added: <br>&gt; + ----- Method: SpurMemoryManager&gt;&gt;findAPig (in category 'compaction - analysis') ----- <br>&gt; + findAPig <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;"Answer a large low free chuink." <br>
&gt; + &nbsp;&nbsp;&nbsp;&nbsp;&lt;doNotGenerate&gt; <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;| pig | <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;self allObjectsInFreeTreeDo: <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[:f| <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(self bytesInObject: f) &gt;= 1000000 ifTrue: <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[(pig isNil or: [pig &gt; f]) ifTrue: <br>
&gt; + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[pig := f]]]. <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;^pig! <br>&gt; <br>&gt; Item was added: <br>&gt; + ----- Method: SpurMemoryManager&gt;&gt;largeFreeChunkDistribution (in category 'compaction - analysis') ----- <br>
&gt; + largeFreeChunkDistribution <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;"This method answers a sorted collection of the free chunks &gt;= 1,000,000 bytes long, <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp; sandwiched between nilObj and the end of memory (ignoring the large chunk often found at the end of the heap)." <br>
&gt; + &nbsp;&nbsp;&nbsp;&nbsp;&lt;doNotGenerate&gt; <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;| freeChunks | <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;freeChunks := SortedCollection new. <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;self allObjectsInFreeTreeDo: <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[:f| <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;((self addressAfter: f) &lt; endOfMemory <br>
&gt; + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; and: [(self bytesInObject: f) &gt;= 1000000]) ifTrue: <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[freeChunks add: f]]. <br>&gt; + &nbsp;&nbsp;&nbsp;&nbsp;^{{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>
</blockquote></div><br></body></html>