<div dir="ltr">Hi Max,<div class="gmail_extra"><br><div class="gmail_quote">On Sun, May 7, 2017 at 4:24 AM, Max Leske <span dir="ltr"><<a href="mailto:maxleske@gmail.com" target="_blank">maxleske@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I'm trying to store an image segment with the latest pharo.cog.spur VM (32 bits) but keep failing. The segment should produce a file of around 60 MB. With an old V3 VM this is no problem at all. There, the WordArrayForSegment instance has a size of 4094179 but with the new VM I always run out of space because the primitive returns nil and, therefore, the word array size is constantly being increased.<br></blockquote><div><br></div><div>It's been a while since I wrote this code so my understanding has been coming back in fits and starts.  The limitation on the use of the hash bits field is in referring to "out pointers", objects that the saved segment refers to, not on objects internal to the segment.  So I think it's fixable.</div><div><br></div><div>The hash field is used to map from an object in the heap to its object in the segment.  Right now the mapping is from hash (22 bits) to location in the segment / 8, and so limits the size of the segment to 500kb.  If an extra level of indirection was added so that hash maps to index in an array of oops, then the segment could contain up to 4m objects and I think that'll be large enough for your use.</div><div><br></div><div>If that's still not enough then the al;goriqhm will have to be rewritten to use the first field of the object in the heap to point to its location in the segment, and the first field saved alongside.</div><div><br></div><div>So let me know.  Would you be happy with a fix that provides up to 4m objects per segment or would you want to wait for something with a much higher limit?</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I've built a debug VM and am stepping through the code but I don't have a clear understanding of everything that's happening. The failure happens on line 46626 of gcc3x-cointerp.c:<br>
<br>
newOop = (copy - segStart) / 8;<br>
if (newOop > (identityHashHalfWordMask())) {<br>
        return PrimErrLimitExceeded;  // <--------------- failure<br>
}<br>
<br>
What I don't understand, for example, is why "newOop" is checked against "identityHashHalfWordMask()" and not against the segment end ("endSeg"). Here's a list of the current values of the variables upon failure:<br>
<br>
objOop  sqInt   180812096<br>
segAddr sqInt   494731288<br>
segStart        sqInt   461176856<br>
endSeg  sqInt   815841432<br>
bodySize        usqInt  64<br>
contextSize     sqInt   335672448<br>
copy    sqInt   494731288<br>
hash    sqInt   0<br>
hash1   sqInt   4194302<br>
i       sqInt   833574680<br>
iLimiT  sqInt   833574688<br>
methodHeader    sqInt   1193471<br>
newOop  sqInt   4194304<br>
numMediatedSlots        sqInt   833574688<br>
numSlots        usqInt  14<br>
oop     sqInt   142640272<br>
<br>
As you can see, "endSeg" would be more than large enough to hold the object. Is it possible that there's an error here?<br>
<br>
Cheers,<br>
Max<br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div>
</div></div>