Compiling a 10.000 line file exhausts memory
I have a project that depends on happy/alex to generate parsers. (https://github.com/TOSPIO/pyn)
Running cabal repl
on my laptop with 16GiB memory ended up eating up all memory and eventually resulted in kernel panic.
Problem arises when compiling the giant happy-generated dist/build/Language/Python/Parser/Parse.hs file. The memory usage is flat (~1.5G) within the first 2 mins, and the soars up to over 10GB within seconds.
cabal build
and cabal repl --ghc-options=-fobject-code
works fine.