GHC memory usage when typechecking from source vs. loading ModIfaces
Matthew Pickering
matthewtpickering at gmail.com
Mon Feb 10 12:13:24 UTC 2025
Sure, you can remove them once you are sure they are not used anymore.
For clients like `GHCi` that doesn't work obviously as they can be used at
any point in the future but for a batch compiler it would be fine.
On Mon, Feb 10, 2025 at 11:56 AM ÉRDI Gergő <gergo at erdi.hu> wrote:
> On Mon, 10 Feb 2025, Matthew Pickering wrote:
>
> > I wonder if you have got your condition the wrong way around.
> >
> > The only "safe" time to perform rehydration is AFTER the point it can
> never be used
> > again.
> >
> > If you rehydrate it just before it is used then you will repeat work
> which has already
> > been done. If you do this, you will always have a trade-off between
> space used and
> > runtime.
>
> Oops. Yes, I have misunderstood the idea. I thought the idea was that
> after loading a given module into the HPT, its ModDetails would start
> out small (because of laziness) and then keep
> growing in size as more and more of it are traversed, and thus
> forced, during the typechecking of its dependees, so at some point we
> would want to reset that into the small initial representation as created
> by initModDetails.
>
> But if the idea is that I should rehydrate modules when they can't be used
> anymore, then that brings up the question why even do that, instead of
> straight removing the HomeModInfos from the HPT?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20250210/f7eb7594/attachment.html>
More information about the ghc-devs
mailing list