MLton space pig

Henry Cejtin henry@sourcelight.com
Mon, 28 May 2001 00:17:42 -0500


Something  is  funny  space-wise  in the 2001-03-21 version of MLton.  If you
grab the URL
    http://sourcelight.com/Z/bloat.tgz
you will see a SML program.  The whole thing is only 483 lines worth  of  SML
code,  nothing  fancy,  no  functors,  and  yet it requires 512 meg of RAM to
compile.  I ran it with -v3 and turning on gc-messages.  The max live is just
under 150 megabytes.  Other than all the gc messages, and the various listing
of /tmp files, the message just before the blowup is
    outputAssembly starting
and the message just after is
    translateChunk totals 0.03 + 0.0 (0.0% GC)

The compile also took 73 CPU seconds, which seems a bit much given  how  much
smaller  it  is  than the self compile, but I'm not really concerned by that.
My concern is  this  real  blow-up  in  space  used,  which  means  even  for
relatively small programs you need a rather large machine.  To be specific, I
can't compile this program on my laptop (which only has 128K), which is  both
surprising and a pain.

Just  in  case, I tried doing the compile with -no-polyvariance.  This had no
effect on either max bytes live or CPU time.

Could you either try this out on the latest version, or make an RPM  up  with
the latest one so I can try it?