The root bit must mark all objects, and the root table must contain all objects that<div>a) are in old space and</div><div>b) refer to objects in</div><div><br></div><div>i.e. to find all roots into youngSpace the GC must be able to find all candidates in the root table. &nbsp;The root bit is a flag that saves searching the root table when adding a new root to the root set. &nbsp;</div>
<div><br></div><div>So yes, when creating a new image, all objects are in oldSpace and so no objects need to be in the rot table or have their root bit set.</div><div><br></div><div>This raises another point of ignorance for me. &nbsp;I would have thought that it is OK for the root bit to be set or the root table to contain objects that are not in old space or do not/no longer refer to objects in youngSpace because the GC will remove these from the root table on GC. &nbsp;But I don&#39;t see where objects get cleared from the rootTable. &nbsp;I only see the RootTable being voided when it gets full (rather drastic). &nbsp;Can anyone say if this happens or not, and if so, where it happens?<br>
</div><div><br></div><div>Looks to me like either markAndTrace: or a specialized version, say markAndTraceRootObject:, should maintain a flag, refersToYoungObject, and clear the object from the rootTable (and clear the root bit) if&nbsp;refersToYoungObject is false at the end of the scan. &nbsp; But with the pointer reversal algorithm it is hard to see where to maintain this flag.</div>
<div><br></div><div>Can those who know enlighten this ignorant soul?</div><div><br></div><div>TIA</div><div><br><div class="gmail_quote">On Sat, Feb 21, 2009 at 4:42 AM, Igor Stasenko <span dir="ltr">&lt;<a href="mailto:siguctua@gmail.com">siguctua@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,<br>
i&#39;d like to ask, is it safe to clear the root flag for every object in system.<br>
I&#39;m artificially creating a new image, and i&#39;d like to know, what<br>
objects should be marked as roots initially, or VM can care about it<br>
itself?<br>
<font color="#888888"><br>
--<br>
Best regards,<br>
Igor Stasenko AKA sig.<br>
</font></blockquote></div><br></div>