[MLton] share weirdness

Matthew Fluet fluet@cs.cornell.edu
Fri, 21 Apr 2006 08:40:57 -0400 (EDT)

> But the two machines have exactly the same amount of memory, so shouldn't the
> heap sizes be the same?

If totalRam() reports (exactly) the same amount of memory, then the 
runtime will attempt to aquire the same size heap on both machines.  But, 
whether or not virtual address space fragmentation allows you to get 
exactly the same results from mmap calls seems unlikely, especially since 
you are comparing a 2.6 uniprocessor kernel to a 2.4 multiprocessor 
kernel.  Even if the kernel differences don't impact the memory available 
to user processes, my guess is that your glibc shared library isn't 
exactly the same, that your libgmp shared library is processor dependent 
(and hence isn't exactly the same), etc.

Once one call to mmap returns a different result on one machine from the 
same call on the other machine, your likely to just keep magnifying the 
differences between the two processes.