[squeak-dev] oldBaseAddr

John M McIntosh johnmci at smalltalkconsulting.com
Mon Aug 24 22:49:19 UTC 2009


On 24-Aug-09, at 1:09 PM, Eliot Miranda wrote:

>
>
> On Mon, Aug 24, 2009 at 12:48 PM, Ang Beepeng <beepeng86 at yahoo.com>  
> wrote:
>
> Thank you very much.
>
> Do you mean that during squeak start-up, process of memory allocation
> somehow make memStart to have value according to the image loaded. And
> therefore the same as oldBaseAddr which is  from the same image.
> (I know very little about memory allocation in every aspect, sorry  
> about
> that)
>
> No.  The issue is that memStart is where the OS gives it to you.  It  
> could be anywhere.  It could also change between two slightly  
> different VMs on the same platform, because one VM might have more  
> code and therefore memStart would end up at a higher address.



Which is why the macintosh carbon and iPhone VM's cheat and ask the  
virtual memory mapping system to map memory at the 500MB boundary.
Usually the Virtual Memory subsystem grants the wish and memStart is  
500MB. This then is compared to the old base address which usually  
would be 500MB and
the result is zero, so no address adding has to occur. Even if the VMs  
are different versions this doesn't matter since the boundary is high  
enough to account for minor VM size changes.

This is very important on the iPhone VM, since if we don't need to  
visit every object in the oops heap we avoid actually paging the page  
from flash into ram.
For WikiServer we end up paging oh say 5.5MB from flash into ram, the  
other 5MB is left in flash.
If we had to remap all the oops then we would end up dragging all  
11.5MB from flash into ram.

This is less important on os-x since the mmap logic drags all the  
pages from file to ram memory, used or not.
Still we avoid the computational overhead if nothing is moved.
--
= 
= 
= 
========================================================================
John M. McIntosh <johnmci at smalltalkconsulting.com>   Twitter:   
squeaker68882
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
= 
= 
= 
========================================================================







More information about the Squeak-dev mailing list