[MLton] Crash fread(...) failed (only read 0) (Cannot allocate memory) during deepFlatten with MLton 20070826

Matthew Fluet fluet at tti-c.org
Sun Apr 20 16:59:31 PDT 2008


On Sun, 20 Apr 2008, Matthew Fluet wrote:
> It occurs when the runtime system decides to page the heap to disk in order 
> to free up virtual memory to reallocate the heap at a larger size.
> It will do this if the desired heap size is approaching the physical memory 
> limit, even if there is plenty of swap space available on the machine.

Actually, this isn't right.  The runtime will attempt to page to disk only 
if creating a heap of the minimum size cannot be satisfied with the 
existing heap resident.

It is curious that your program compiles without paging the heap to disk 
on the 4G machine, but not on the 2G machine, since the virtual memory 
address space should be the same on the two machines.  That is, the amount 
of physical memory shouldn't affect whether the virtual memory system is 
able to satisfy the request.

Of course, starting off with different physical memory sizes means that 
different heap sizes will be realized by the compile on the two machines, 
so the point at which the paging occurs on the 2G machine may not 
correspond to any GC on the 4G machine.




More information about the MLton mailing list