Re: max-heap setting for 64-bit applications

Matthew Fluet <[email protected]>
Newsgroups gmane.comp.lang.ml.mlton.devel
Message-ID <[email protected]>
On Fri, Dec 11, 2009 at 10:56 PM, Henry Cejtin
<[email protected]> 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.)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.