"containing" memory-consuming computations

Bardur Arantsson spam at scientician.net
Thu Apr 19 17:44:32 CEST 2012

On 04/19/2012 12:45 PM, Herbert Valerio Riedel wrote:
> Hello GHC Devs,
> But I'm missing a similar facility for constraining the
> space-dimension. In some other languages such as C, I have (more or
> less) the ability to check for /local/ out-of-memory conditions (e.g. by
> checking the return value of e.g. malloc(3) for heap-allocations, or by
> handling an OOM exception), rollback the computation, and be able to

Just a minor point which may be of interest: Many operating systems 
(including Linux by default) overcommit memory, so there is in fact no 
guarantee that memory returned by malloc() will in fact be usable under 
memory pressure.

So, getting a non-NULL pointer from malloc() is not a guarantee.

(There are good reasons for this behavior.)


More information about the Glasgow-haskell-users mailing list