<br><br><div class="gmail_quote">On Mon, Jul 19, 2010 at 6:16 AM, Mariano Martinez Peck <span dir="ltr">&lt;<a href="mailto:marianopeck@gmail.com">marianopeck@gmail.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>Hi. Nebwie here. THe first question is if objects are moved (changed the address in memory) at runtime? </blockquote><div><br></div><div>yes.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
 I am 99% sure the answer is true. If so:<br><br>1) Who moves them ? the GC?<br></blockquote><div><br></div><div>yes.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
2) when ?  agains which events, what triggers these movements?<br></blockquote><div><br></div><div>during garbage collection</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

3) why they are moved?  to compact the memory ?  why the memory needs to be compact? for arrays?<br></blockquote><div><br></div><div>In Squeak&#39;s case to compact memory.  But scavenging/two-space-collection is a widely used technique that works by copying the live objects from one space into another, com[acting as it goes, and so it is expected with modern algorithms that memory is compacted as garbage is collected.  See Paul Wilson&#39;s <a href="http://www.complang.tuwien.ac.at/ulrich/gcsurvey.ps.gz">Uniprocessor Garbage Collection Techniques</a>.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">4) Is there a way to say &quot;please, don&#39;t move this object X&quot; ?  what would be the problem of having a lot of these &quot;non-moveable&quot;  objects? memory fragmentation ?<br>
</blockquote><div><br></div><div>Not yet.  I&#39;m working on it for Teleplace&#39;s threaded Cog VM.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
If you can point me to the code also I would be happy.<br></blockquote><div><br></div><div>See the garbage collection and gc protocols in ObjectMemory and (in Cog) NewObjectMemory in VMMaker.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>Thank you very much in advance,<br><br>Mariano<br></blockquote><div><br></div><div>HTH</div><div>Eliot </div></div>