ghc --make seems to leak memory
(This is probably not reproducible with a small example.) When I build this project with cabal build
https://github.com/LambdaHack/LambdaHack/commit/138123ab13edd4db6c8143720af68b6ec4a1726e
the peek memory, as observed with top
, is 10G*. When I instead interrupt the compilation with ^C
at the following point (compilation of this file take a couple of minutes, so it's easy to interrupt):
[123 of 123] Compiling Game.LambdaHack.SampleImplementation.SampleMonadServer ( Game/LambdaHack/SampleImplementation/SampleMonadServer.hs, dist/build/Game/LambdaHack/SampleImplementation/SampleMonadServer.o )
and then restart and continue to the end, peek memory usage in either of the two compilation parts is 5G*. So it seems ghc --make
keeps some data that is either eventually not used or could as well be read on demand instead of kept in memory. Confirmed with 8.2.1-rc1 as well, but it's not trivial to compile due to restrictive upper bounds of many packages.
- exact numerical values are made up
Edit: this is a regression, GHC 7.10.3 uses < 3G for compilation without even interrupting
Edit2: which actually doesn't prove the --make
leak is a regression. There may just be some other regression that makes the difference between interrupted and non-interrupted compilation under 7.10.3 much smaller and harder to measure.