Low-space signals in production environments

John M McIntosh johnmci at smalltalkconsulting.com
Sun Feb 11 19:20:13 UTC 2007


On Feb 11, 2007, at 2:08 AM, Andreas Raab wrote:

>
>
> Not really. Whether the VM is capable of allocating memory or not  
> is a binary decision. There is nothing complicated about it.  
> Whether it can recover from a failed allocation is of course a  
> different question but that's why we have the red zone which  
> triggers a low space condition when we enter it - the red zone is  
> still sufficient to do a variety of things. But when allocation  
> fails, it fails, there is no policy. It fails.

Well you get to invent new Policy.

My comment about having basicNew tell the VM there is a problem and  
then retry with failure *after* something has been done, seemed  
fairly reasonable.

Your example of Array new: SmallInteger maxVal would of course fail  
because the Policy (TM) would look at say oh currently used memory +  
(SmallInteger maxVal) > ceiling of Mac Carbon VM (which by default is  
512k)  thus your toast.    Some complication exist because once you  
are into failure mode is that because of an extra-ordinary request or  
are you hitting the maximum celing . One could of course have a chunk  
of reserved memory that one could free (couple of MB?)  Still in  
cases of recursive runaway process it's difficult to provide enough  
time for the developer to do something.

One could even determine which processes *must* run, versus user  
processes which could be halted at the time of allocation failure.

>
> Cheers,
>   - Andreas
>

--
======================================================================== 
===
John M. McIntosh <johnmci at smalltalkconsulting.com>
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
======================================================================== 
===





More information about the Squeak-dev mailing list