[MLton] Re: [MLton-user] MLton on mswin7 absurdly slow ?

Wesley W. Terpstra wesley at terpstra.ca
Mon Feb 7 00:26:09 PST 2011


On Mon, Feb 7, 2011 at 3:59 AM, John B Thiel <jbthiel at gmail.com> wrote:

> on a 1.66GHz/1GB ram/mswin7 notebook (well loaded, 12+ apps open)


This sounds like the root of the problem. With 1GB of physical RAM, MLton
decides to use up to 512MB of it. Given you have 12+ apps open, it seems
quite likely that the other apps have a combined working set + pinned pages
exceeding the 512MB. Hence the thrashing.

The policy of "half of physical RAM" is just a rule of thumb. The more
heavily loaded your machine (as a percentage of physical RAM) the less
appropriate it becomes.

It seems there is some runaway allocation with the default options on
> Windows, that unnecessarily overdrives into swap/thrashing.
>

I don't think it's runaway allocation.

If I recall correctly, MLton will use copying collection with a heap size of
twice the live set up until this would exceed the 50% mark. Since we've
established that your hello-world program needs ~100MB, MLton will allocate
400MB. That leaves 600MB for everything else during a garbage collection. I
believe Windows 7 takes somewhere in the ballpark of 200-300MB on its own,
so that leaves just 300MB for your 12+ applications.

So, my suggestions:
1. buy another 1GB of memory which should solve your problem outright (MLton
will leave 1GB to the other 12+ apps, which must be enough since you have
that much memory at the moment)
2. close all the applications you can while working on your MLton-compiled
projects

Keep in mind that for larger projects 100MB will not be enough to compile
them.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mlton.org/pipermail/mlton/attachments/20110207/a5007161/attachment.html


More information about the MLton mailing list