Skip to content

apparent memory leak in --make mode (compiling base library during building ghc)

I've noticed that my memory usage slowly goes up and up, and not down until the ghc-inplace ... --make ... -O ... of all base at once finishes. There is not such a memory reduction between the individual file compilations within the --make. By the end it's using around 200-400 MB of memory. Compiling files individually doesn't seem to have such a large memory occupancy. I could probably gather more details/sureness if it would be useful... for now I am just noting this effect. (I think when I built jhc, which is built using ghc --make, it also ended up using large amounts of memory.) Is the high memory usage just a symptom of importing lots of modules even with separate invocations of ghc, or is ghc remembering more than it needs to in --make mode, or does remembering all the .hi contents at once, of all modules that have been compiled and will be needed sometime in future compilation, take that much memory?

Trac metadata
Trac field Value
Version 6.7
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system Unknown
Architecture Unknown
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information