Bad memory retainer when reloading multiple times in GHCi on ghc master
Summary
On today's master, I checked GHCi on a big private project and reload a module (which is upper-most dependency that triggers recompiling almost all the modules in the project) a few times and check the memory profile (attached picture produced by eventlog profiling). The memory kept growing. This growing behavior does not happen with GHC 9.6.2 on the same repo, so the bug must be introduced recently.
Steps to reproduce
I think this can be reproduced with other public repos like Agda. in GHCi, reload an upper dependency that triggers a sweep of recompilation and watch the memory (or profile it).
Expected behavior
The memory footprint should not increase indefinitely.
Environment
- GHC version used: GHC 9.9.20231019 (921fbf2f)
- Operating System: macOS Sonoma 14.0
- System Architecture: macbook pro m1 (aarch64)