[MLton] max-heap setting for 64-bit applications

Florian Weimer fw at deneb.enyo.de
Mon Dec 14 10:15:53 PST 2009


* Matthew Fluet:

> Oh, I certainly understand that under-the-hood any VMM is likely to
> have the reserve/commit distinction; plus plenty more subtleties:
> sharing of zero-pages, copy-on-write for fork-exec, etc., etc.  But,
> if it isn't exposed in a user-space ABI, then it isn't "there" for us.
>  Windows, on the other hand, *requires* the user to manage the
> distinction via the published user-space ABI.

Linux exposes the distinction as well if you set vm.overcommit_memory
to 2.  There's just no ABI guarantee how to reserve part of the
address space without having it to count towards the commit limit.
The PROT_NONE business seems to work, but most run-time libraries
allocating a single heap block get this wrong.



More information about the MLton mailing list