Well well well, this is nice, now I&#39;m getting more into this. Thanks all for the quick answers! The iSqueak wiki (which I had seen before but thought it only had info about iPhone) helped a lot. <br><br>Here are some concepts I got (hope they are right)<br>

<br>The heap is at a virtual address that depends on the platform. Many platforms try to put it starting at a fixed virtual address (like 500M or 512M). Unix doesn&#39;t bother. <br><br>The use of /dev/null mapping in unix is not that important because of mmap&#39;s  MAP_PRIVATE flag, which makes a copy of the mapped object after first write. In mac it uses the image file instead and MAP_SHARED, which may actually change the image file on memory writes. So in that case I wonder why it doesn&#39;t happen (or it does?), maybe because the file is closed after initialization?<br>

<br>After loading, as oops are virtual memory addressed, they are iterated (in case the heap isn&#39;t loaded in a fixed position, ie. unix) and adjusted to the new heap start.<br><br>Also -this confused me a bit-, in some platforms you mmap a heap of size much bigger than image size, like 512MB (this was what puzzled me, I confused it with memory address offset). In the end you get 512MB mapped at offset 500M, of which the OS only reserves the used part. In the space between 0 and 500M lies the VM, stack globals and other stuff.<br>

<br>Excelent, now for SqueakNOS we may use the total amount of available memory, as Bert said, but we have to be carefull: Saving the image requires disk access, which is now done by a beautiful disk driver written in smalltalk (no file-write primitives). Our idea then is that inside primitiveSnapshot we make the snapshot go temporarily to a byte array instead of disk, and after resuming the interpreter we send the order to write to disk. As you can imagine, this has the drawback of requiring double of image size be reserved in memory among other things, but should work. We are open to more elegant ideas, of course!<br>

<br>As for heap mem allocating have a look at what we have now in squeaknos...<br><br><span style="font-family: courier new,monospace;">sqInt sqGrowMemoryBy(sqInt oldLimit, sqInt delta)    {</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">       // XXX: We should check available memory here.</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    return oldLimit+delta; </span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">}</span><br><br><br>Thanks!<br>           Javier.<br><br><br><div class="gmail_quote">On Tue, May 11, 2010 at 9:10 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="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="h5"><br>
On 12 May 2010 01:58, Bert Freudenberg &lt;<a href="mailto:bert@freudenbergs.de">bert@freudenbergs.de</a>&gt; wrote:<br>
&gt;<br>
&gt; Am 11.05.2010 um 15:50 schrieb John M McIntosh:<br>
&gt;&gt; So as Bert said malloc() is the simplest solution...<br>
&gt;<br>
&gt; I actually didn&#39;t mention malloc(). Since in SqueakNOS there *is* no operating system, I&#39;d have thought you don&#39;t even need to malloc().<br>
&gt;<br>
<br>
</div></div>Yeah, i think SqueakNOS  could simply declare an appropriate address<br>
space range as its own, and just use it :)<br>
<br>
<br>
&gt; - Bert -<br>
<div><div></div><div class="h5">&gt;<br>
&gt;<br>
&gt;<br>
<br>
<br>
<br>
--<br>
Best regards,<br>
Igor Stasenko AKA sig.<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Javier Pimás<br>Ciudad de Buenos Aires<br>