Profiling causes excessive memory usage

Nicholas Kidd <[email protected]>
Newsgroups gmane.comp.lang.ml.mlton.devel
Message-ID <[email protected]>
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

_______________________________________________
MLton mailing list
[email protected]
http://mlton.org/mailman/listinfo/mlton
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.