[MLton] out of memory when compiling MLKit

Matthew Fluet fluet@cs.cornell.edu
Mon, 25 Apr 2005 10:26:54 -0400 (EDT)


One thing you may try is to compile with "-drop-pass deepFlatten" to skip
the pass which is exhausting memory.  In theory, the only live data from
one optimization pass to the next is the representation of the program.

The timings and GC percentages for the other passes seem reasonable,
although a little higher than I see on a self-compile of mlton.  If
dropping the deepFlatten pass allows the compilation to complete, then it
points to a performance problem in deepFlatten.

Jesper's suggestion of -verbose 3 will give a little more info, but I 
suspect that the sizes will be reasonable, even if they are large.

-Matthew

> I have tried compiling the MLKit compiler using MLton
> 20041109. Unfortunately, compilation stops with an out-of-memory error
> on our 4G (2G) RAM X86 machine. Below follows a dump of the
> compilation messages together with some machine info. Does anyone know
> of some options I can give to MLton to make it use less memory? The
> MLton process dies when it reaches 2G virtual memory use.
>
>            toSsa2Simplify starting
>               checkScopes starting
>               checkScopes finished in 3.17 + 8.37 (73% GC)
>               deepFlatten starting
>   08048000-0896d000 r-xp 00000000 08:0a 3313502    /home/mael/mlton-20041109/build/lib/mlton-compile
>   0896d000-08b05000 rw-p 00925000 08:0a 3313502    /home/mael/mlton-20041109/build/lib/mlton-compile
>   08b05000-08b2f000 rwxp 08b05000 00:00 0
>   40000000-40015000 r-xp 00000000 08:05 390916     /lib/ld-2.3.4.so
>   40015000-40017000 rw-p 00014000 08:05 390916     /lib/ld-2.3.4.so
>   40017000-40018000 ---p 40017000 00:00 0
>   40018000-4001c000 rw-p 40018000 00:00 0
>   4001c000-4001d000 ---p 4001c000 00:00 0
>   40020000-40021000 rw-p 40020000 00:00 0
>   40021000-40041000 r-xp 00000000 08:05 1596273    /lib/libm-2.3.4.so
>   40041000-40043000 rw-p 0001f000 08:05 1596273    /lib/libm-2.3.4.so
>   40043000-4014b000 r-xp 00000000 08:05 390915     /lib/libc-2.3.4.so
>   4014b000-4014c000 ---p 00108000 08:05 390915     /lib/libc-2.3.4.so
>   4014c000-4014d000 r--p 00108000 08:05 390915     /lib/libc-2.3.4.so
>   4014d000-40150000 rw-p 00109000 08:05 390915     /lib/libc-2.3.4.so
>   40150000-beff6000 rw-p 40150000 00:00 0
>   bf00d000-bffcb000 rw-p bf00d000 00:00 0
>   bfffb000-c0000000 rwxp bfffb000 00:00 0
>   ffffe000-fffff000 ---p 00000000 00:00 0
>   Out of memory.