Hi,<br>        I&#39;m working in memory management of SqueakNOS platform. Currently we use a static size heap, and we&#39;ll probably have to change that. I read in the blue book that the heap is implemented as a <b>contiguous</b> chunk of memory, is the heap done that way in squeak?<br>

        I looked how it&#39;s implemented in unix and saw that sqAllocateMemory uses mmap. I don&#39;t have experience with this function, but I wonder if it means that the heap is allocated in a virtual contiguous chunk that gets mapped to some place in disk. Or maybe it just reserves contiguous virtual addresses that are in different blocks of real memory?<br>

<br>        The alloc line is this, (sqUnixMemory.c)<br><span style="font-family: courier new,monospace;"><br>if (MAP_FAILED == (heap= mmap(0, heapLimit, MAP_PROT, MAP_FLAGS, devZero, 0)))</span><br><br>        Also, other question is what is this mapping to /dev/zero? Then reading from the heap wouldn&#39;t return allways zero? Is it because this mmap isn&#39;t actually backed by any file? Does mmap reserve heapLimit bytes in real memory? I mean, if you write to the mapped address, you write to real memory, device memory, or both?<br>

<br>        Lastly, growing the heap gets to this:<br><br><span style="font-family: courier new,monospace;">if (MAP_FAILED == mmap(base, newDelta, MAP_PROT, MAP_FLAGS | MAP_FIXED, devZero, heapSize))</span><br><br>which doesn&#39;t alter heap start, so it has to be that when resizing the heap the only thing that happens is that some memory is reserved and mapped to the ending address of it.<br>

<br>Well as you can see I&#39;m rather confused so any help is wellcome, thanks for reading.<br><br>Javier.<br clear="all"><br>-- <br>Javier Pimás<br>Ciudad de Buenos Aires<br>