[MLton] max-heap setting for 64-bit applications
Matthew Fluet
matthew.fluet at gmail.com
Mon Dec 14 08:44:28 PST 2009
On Fri, Dec 11, 2009 at 10:56 PM, Henry Cejtin
<henry.cejtin at sbcglobal.net> wrote:
> With regards to the max-heap argument, it would be really good to have
> an argument which is the maximum amount of memory MLton can use, or as
> close as we can come to that. If it tries to grow bigger, even if only
> temporarily to grow a heap, and can't grow it by any other allowed
> means, it should fail with out of memory.
I think the only way one could use such an argument would be to
malloc/mmap that whole space at the beginning of the program and never
release or resize it. We could still make use of a smaller heap
within that reserved space, and let the OS VMM page out the unused
pages. (Or, on Windows, use the reserve/commit distinction. On
Posix, use the madvise to preemptively indicate page-out/page-in
behavior. I think I recall seeing that some *BSDs allow you to get
the reserve/commit distinction that Windows provides.)
More information about the MLton
mailing list