<br><br><div class="gmail_quote">On Wed, Apr 4, 2012 at 8:14 PM, 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>
On 4 April 2012 19:14, Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>&gt; wrote:<br>
<div class="im">&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Wed, Apr 4, 2012 at 8:55 AM, Mariano Martinez Peck &lt;<a href="mailto:marianopeck@gmail.com">marianopeck@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On Wed, Apr 4, 2012 at 5:32 PM, Mariano Martinez Peck &lt;<a href="mailto:marianopeck@gmail.com">marianopeck@gmail.com</a>&gt; wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Hi guys. I noticed that there is a limit in the number of objects you can become. In my case, I am becoming 2312157 objects. So..I don&#39;t expect that the become works. I imagine that it was not designed for so many objects in mind ;)<br>

&gt;&gt;&gt; However, what I would really understand is where is the limitation and the reason.<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
</div>&gt; The limitation is in the number of forwarding blocks.  For a two-way become you need N * 2 forwarding blocks.  for a become forward 1-way become you need N forwarding blocks.  Each forwarding block takes two words (a saved header word and the new location).  During forwarding each forwarded object&#39;s header is changed to a pointer to its forwarding block.  See prepareForwardingTableForBecoming:with:twoWay: &amp; fwdTableInit:.  The number of forwarding blocks available depend on the amount of unused heap memory.   So there is no fixed limit and growing memory will lift the limit, as may doing a GC (as you yourself found).<br>

&gt;<br>
<br>
i was looking at that method.. and i am quite displeased.. :)<br>
<br>
IMO, we could simplify the forwarding table logic by changing the<br>
primitive to take 3 arguments instead of 2<br>
<br>
1) first array<br>
2) second array<br>
3) buffer for forwarding table entries (byte array)<br>
<br>
and for backward compatibility, if primitive is run with just 2 arguments, we<br>
could simply silently allocate new bytearray with our preferred size.<br>
<br>
then there will be no need to do the black magic with #fwdTableInit:<br>
as well as any other operations which involving changing the free memory.<br>
<span class="HOEnZb"><font color="#888888"><br></font></span></blockquote><div><br>That would be nice. Right now the workaround I did is to spit my become in groups of say 50.000 objects. Problem is that now I need much mores memory traversals than one ;)   And I am not 100% sure that won&#39;t crash in the future (who knows how many free memory I will have)<br>
<br><br><br> </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="HOEnZb"><font color="#888888">
--<br>
Best regards,<br>
Igor Stasenko.<br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br>Mariano<br><a href="http://marianopeck.wordpress.com" target="_blank">http://marianopeck.wordpress.com</a><br><br>