<div dir="ltr">10/6/04  How memory is allocated<br><br>9/21/02  Memory allocation on the Mac?<div><br></div><div style>As this topic is a good twelve years old you&#39;ll have to rely on my foggy memory.</div><div style><br>
</div><div style>I recall it coming from the windows vm. The intent was to allocate memory from the VM and ensure parm 25 was at least free, later on a check after a full GC if we have free memory &gt; parm 24 free we release memory back to the operating system.  However since Squeak allocates a contiguous check of memory versus segments this is tricky for some operating systems. </div>
<div style><br></div><div style>At the time &gt; 10 years back I choose for the mac vm just to move pointers around versus unmapping.  </div><div style>Ian did implement a unix unmapping, but later withdrew it some unix flavors had buggy implementations of unmapping </div>
<div style><br></div><div style>Note in some os-x/ios memory allocation code I opt via a suggestion from David Pennell to mmap the image, then mmap free space. Which leads to some interesting behaviour on IOS. Some N milliseonds shaved off startup time on 199x era macs, but then exposed the bug in OS-X NFS drivers if you attempt to mmap a file on a NFS drive. Might be fixed now? </div>
<div style><br></div><div style>As my iOS images were always setup read only, I never pursued setting the mmap to shared and then confirming a virtual memory manager flush/sync would in fact write out all the changed pages and newly allocated free pages to the original file, as that required copying the base image from the app readonly resource directory to the read/write directory and on the iPhone 3G that took seconds.. </div>
<div style><br></div><div style><br></div><div style><br></div><div style><br></div><div style><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Oct 16, 2013 at 1:06 PM, Eliot Miranda <span dir="ltr">&lt;<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@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><div dir="ltr">Hi All,<div><br></div><div>    can anyone give me a specification of parameter 25&#39;s behaviour?  25 is the grow headroom:</div>
<div>        &quot;25<span style="white-space:pre-wrap">        </span>memory headroom when growing object memory (read-write)&quot;</div>
<div><br></div><div>what does this mean?  That growth should be at least this much?  That growth should be in multiples of this?  That growth should not be done if free memory exceeds this?  Or...?<br clear="all"><div><br>

</div>-- <br>best,<div>Eliot</div>
</div></div>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>===========================================================================<br>John M. McIntosh &lt;<a href="mailto:johnmci@smalltalkconsulting.com" target="_blank">johnmci@smalltalkconsulting.com</a>&gt;<br>
Corporate Smalltalk Consulting Ltd. Twitter: squeaker68882<br>===========================================================================<br><br>
</div>