Win32 cross-compiling so far...

Stephen Weeks MLton@sourcelight.com
Thu, 13 Sep 2001 09:30:37 -0700


> > Hmm.  MLton can self compile without problems using 450M RAM.  Further, it will
> > only request 85% of total RAM.  It must be other stuff running on your machine.
> 
> Well, I installed the binary version for Linux from your homepage,
> and did a compilation to Linux of the source code from your homepage.
> I was running top and it was very clear that the process mlton was
> using about 860 MB RAM a lot of the time. I even shut down X-Windows
> to gain a little more mem... I think it's very strange if you say
> it should only use 450 MB.

Strange indeed.  We should figure this out.  Since you only have 512M RAM, my
first guess is that the sysinfo call in gc.c is not returning a reasonable
result and that the gc is therefore confused as to how much RAM you have.  If it
thinks you have 1G, it will certainly try to use it for a self compile.  To
test, this, could you please run a make with the FLAGS line in
src/mlton/Makefile as follows.

FLAGS = @MLton max-heap 450m -- -v -o $(AOUT)

This will restrict mlton to using 450m and will bypass what is returned by
sysinfo.  If that compile succeeds, we need to investigate getRAMsize in gc.c.
Hopefully you can write a little C file to see what getRAMsize is returning.  On
the other hand, if that compile fails, we need to understand why mlton is trying
to use so much memory.  In that case, run a make with a FLAGS line like follows.

FLAGS = @MLton gc-messages gc-summary -- -v3 -o $(AOUT)

Thanks for the help.