Skip to content

GHCi with -fwrite-if-simplified-core doubles the memory use after a type check failure

In a big project, I opened ghci and reloaded a module (very upstream in the dep graph) multiple times, and in the middle, made a type error, then corrected and reloaded a few times more. Then, if I run ghci with -fwrite-if-simplified-core, the memory starts to blow up further after the type error.

For comparison, this is the memory profile without the flag: Screenshot_2023-10-24_at_8.55.50_AM

and this is one with the flag: Screenshot_2023-10-23_at_11.30.42_PM

and I manage to find a step-function increase of data originated from downsweep by info table map profiling. Screenshot_2023-10-24_at_1.35.38_AM

  • GHC version used: GHC 9.6.2
  • Operating System: macOS Sonoma 14.0
  • System Architecture: Apple M1 Max
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information