[MLton] Profiling causes excessive memory usage

Nicholas Kidd nakidd at gmail.com
Mon Dec 6 14:52:14 PST 2010


Hi MLton developers,

I have a program that MLton compiles just fine without profiling turned on;
however, when profiling is enabled via -profile {time,alloc,count}, MLton
runs out of memory in the deepFlatten phase. I haven't yet tried, but I
imagine disabling the deepFlatten pass will allow for compilation to
succeed. Is there a better alternative? What would be the best way to debug
the memory usage? I.e., what information can I gather that would be useful
in debugging the issue?

Some initial information that might be helpful:

:: Machine is a macbook pro 2.8 Ghz with 4GB of memory running OS 10.6.5

:: mlton outputs "MLton 20100608 (built Tue Jun  8 13:10:24 EDT 2010 on
fenrir.cs.rit.edu)"

:: I'm using the 32bit version of MLton (though the same behavior was
observed with the 64bit executable, it just chewed up a lot more memory)

:: A `wc -l *.sml` returns 43357

:: Successful command line is as follows:
mlton -runtime 'gc-summary' -profile no -output athena-profile=no -verbose 2
athena.mlb > build-profile=no.txt 2>&1

:: Unsuccessful command line:
mlton -runtime 'gc-summary' -profile alloc -output athena-profile=alloc
-verbose 2 athena.mlb > build-profile=alloc.txt 2>&1

:: Last few lines of build-profile=alloc.txt
     ssa2Simplify starting
        typeCheck starting
        typeCheck finished in 0.32 + 0.00 (0% GC)
        deepFlatten starting
Out of memory.  Unable to allocate heap with 1,192,034,304 bytes.

That final heap size looks small doesn't it?

Thanks,
Nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mlton.org/pipermail/mlton/attachments/20101206/63fbbaaa/attachment.html


More information about the MLton mailing list