[MLton-devel] Re: [Twelf-developer] Twelf Performance Comparison (ad hoc)

Stephen Weeks sweeks@sweeks.com
Fri, 20 Dec 2002 23:15:19 -0800


> > I don't really have an explanation for these numbers, but
> > they strongly suggest Karl might benefit for working with
> > MLton.
> 
> One thing to look out for here.  My experience running the FPCC suite
> under MLton showed that MLton does not yield unused memory to the
> system as well as SML/NJ (at all?).  For example, while SML/NJ memory
> usage settled at ~200 MB at the end of a run, MLton usage settled at
> ~600 MB.  MLton's speed advantage may turn out moot if the extra VM
> usage results in paging.

MLton is indeed agressive in grabbing and holding on to memory.  If
the amount of live data shrinks quite a bit, MLton will shrink the
heap, but you are right that it will do so reluctantly.  This is for
performance reasons, since the cost of re-mmaping memory and kernel
zeroing of the pages is high.  If it is essential for an application
to release memory, it can call MLton.GC.pack, which shrinks the heap
as much as possible.  You can also adjust the live ratio that MLton
shoots for with runtime system arguments.

As to paging, I assume what you saw was on a machine with more than
600MB of RAM.  MLton is aware of the amount of RAM and will try very
hard to keep the heap size smaller than the RAM size to avoid paging.
This works well if the MLton program is the only one running (which is
at least typically true when running benchmarks :-).  Someday we hope
to even be sensitive to other processes running as well.  In the
meantime, MLton has runtime system options to limit memory usage
either to a fixed amount or a fixed percentage of RAM.

If you've had problems with MLton-generated executables running by
themselve and causing paging, it may be a bug -- please let us
(MLton@mlton.org) know and maybe we can help.

Also, please let us know of interesting benchmark results.  We're
always looking to add new substantial benchmarks to our suite.


-------------------------------------------------------
This SF.NET email is sponsored by:  The Best Geek Holiday Gifts!
Time is running out!  Thinkgeek.com has the coolest gifts for
your favorite geek.   Let your fingers do the typing.   Visit Now.
T H I N K G E E K . C O M        http://www.thinkgeek.com/sf/
_______________________________________________
MLton-devel mailing list
MLton-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlton-devel