Re: [External] Re: GHC memory usage when typechecking from source vs. loading ModIfaces

2025-04-05 Thread Matthew Pickering
ofile, I still get way more than 2k > ModuleNodes and NodeKey_Modules…. > > > > *From:* Matthew Pickering > *Sent:* Tuesday, April 1, 2025 5:44 PM > *To:* Erdi, Gergo > *Cc:* GHC Devs ; ÉRDI Gergő ; > Montelatici, Raphael Laurent ; Dijkstra, Atze > > *Subject:

Re: GHC memory usage when typechecking from source vs. loading ModIfaces

2025-04-05 Thread Matthew Pickering
in attached archives… > > > > *From:* Matthew Pickering > *Sent:* Friday, March 28, 2025 8:40 PM > *To:* Erdi, Gergo > *Cc:* GHC Devs ; ÉRDI Gergő ; > Montelatici, Raphael Laurent ; Dijkstra, Atze > > *Subject:* [External] Re: GHC memory usage when typechecking from so

Re: [External] Re: GHC memory usage when typechecking from source vs. loading ModIfaces

2025-04-04 Thread Matthew Pickering
M > *To:* Erdi, Gergo > *Cc:* GHC Devs ; ÉRDI Gergő ; > Montelatici, Raphael Laurent ; Dijkstra, Atze > > *Subject:* [External] Re: GHC memory usage when typechecking from source > vs. loading ModIfaces > > > > I think you are missing > https://gitlab.haskell

RE: [External] Re: GHC memory usage when typechecking from source vs. loading ModIfaces

2025-04-03 Thread Erdi, Gergo via ghc-devs
gt;>; Dijkstra, Atze mailto:atze.dijks...@sc.com>> Subject: [External] Re: GHC memory usage when typechecking from source vs. loading ModIfaces What command do I run to generate the files from this patch file? Perhaps a link to a git repo would be a suitable way to share the reproduc

Re: GHC memory usage when typechecking from source vs. loading ModIfaces

2025-04-02 Thread Erdi, Gergo via ghc-devs
PUBLIC zcat ../repro-hs.patch.gz |patch -p0 From: Matthew Pickering Sent: Wednesday, April 2, 2025 5:39 PM To: Erdi, Gergo Cc: GHC Devs ; ÉRDI Gergő ; Montelatici, Raphael Laurent ; Dijkstra, Atze Subject: [External] Re: GHC memory usage when typechecking from source vs. loading ModIfaces

Re: GHC memory usage when typechecking from source vs. loading ModIfaces

2025-04-01 Thread Matthew Pickering
nt:* Saturday, March 29, 2025 1:53 AM > *To:* Erdi, Gergo > *Cc:* GHC Devs ; ÉRDI Gergő ; > Montelatici, Raphael Laurent ; Dijkstra, Atze > > *Subject:* [External] Re: GHC memory usage when typechecking from source > vs. loading ModIfaces > > > > > > Hi Gergo,

RE: GHC memory usage when typechecking from source vs. loading ModIfaces

2025-03-31 Thread Erdi, Gergo via ghc-devs
Subject: Re: GHC memory usage when typechecking from source vs. loading ModIfaces This sounds extremely interesting, but I don’t understand where you are getting this number from! How do you see in the eventlog HTMLs that I’ve included that there are ~2000 ModuleGraphs? I’ve now tried using

Re: GHC memory usage when typechecking from source vs. loading ModIfaces

2025-03-31 Thread Erdi, Gergo via ghc-devs
> Cc: ÉRDI Gergő mailto:ge...@erdi.hu>>; Montelatici, Raphael Laurent mailto:raphael.montelat...@sc.com>>; Dijkstra, Atze mailto:atze.dijks...@sc.com>> Subject: [External] Re: GHC memory usage when typechecking from source vs. loading ModIfaces Hi, Unfortunately, I am for

Re: GHC memory usage when typechecking from source vs. loading ModIfaces

2025-03-28 Thread Matthew Pickering
(it >> could be any `Unique`-keyed environment...). >> >> So I am now stuck at this point. To spell out my goal explicitly, I would >> like to typecheck one module after another and not keep anything more in >> memory around than if I loaded them from `ModIface` files

Re: GHC memory usage when typechecking from source vs. loading ModIfaces

2025-03-28 Thread Matthew Pickering
< > ghc-devs@haskell.org> > Cc: ÉRDI Gergő ; Montelatici, Raphael Laurent < > raphael.montelat...@sc.com>; Dijkstra, Atze > Subject: [External] Re: GHC memory usage when typechecking from source vs. > loading ModIfaces > > Hi, > > Unfortunately, I am forced to return to

RE: GHC memory usage when typechecking from source vs. loading ModIfaces

2025-03-28 Thread Erdi, Gergo via ghc-devs
eference). -Original Message- From: ghc-devs On Behalf Of Erdi, Gergo via ghc-devs Sent: Friday, March 28, 2025 4:49 PM To: Matthew Pickering ; GHC Devs Cc: ÉRDI Gergő ; Montelatici, Raphael Laurent ; Dijkstra, Atze Subject: [External] Re: GHC memory usage when typechecking from source v

RE: [External] Re: GHC memory usage when typechecking from source vs. loading ModIfaces

2025-02-04 Thread Erdi, Gergo via ghc-devs
From: Matthew Pickering Sent: Thursday, January 23, 2025 5:51 PM To: Erdi, Gergo Cc: ÉRDI Gergő ; Zubin Duggal ; Montelatici, Raphael Laurent ; GHC Devs Subject: [External] Re: GHC memory usage when typechecking from source vs. loading ModIfaces That's good news. I don't think t

Re: GHC memory usage when typechecking from source vs. loading ModIfaces

2025-01-23 Thread Matthew Pickering
Perhaps I am confused as well. I would have to investigate to see what the precise situation was. On Thu, Jan 23, 2025 at 12:40 PM ÉRDI Gergő wrote: > I'll get back to you with details as I can. > > But one thing I noticed is that contrary to my expectations, when > replacing the ModDetails with

Re: GHC memory usage when typechecking from source vs. loading ModIfaces

2025-01-23 Thread ÉRDI Gergő
I'll get back to you with details as I can. But one thing I noticed is that contrary to my expectations, when replacing the ModDetails with fresh ones, the real cost comes not from the fact that we have to re-evaluate the various parts of the ModDetails, but rather the call to `fillModDetails`

Re: GHC memory usage when typechecking from source vs. loading ModIfaces

2025-01-23 Thread Matthew Pickering
to be a datatype instead of a newtype just so I can see > it in the heap). I expected to see only one. > > > > *From:* Matthew Pickering > *Sent:* Tuesday, January 21, 2025 8:24 PM > *To:* ÉRDI Gergő > *Cc:* Zubin Duggal ; Erdi, Gergo ; > Montelatici, Raphael Laurent ;

Re: GHC memory usage when typechecking from source vs. loading ModIfaces

2025-01-21 Thread Matthew Pickering
Thanks Gergo, I think that unless we have access to your code base or a realistic example then the before vs after snapshot will not be so helpful. It's known that `ModDetails` will leak space like this. Let us know how it goes for you. Cheers, Matt On Fri, Jan 17, 2025 at 11:30 AM ÉRDI Gergő

Re: GHC memory usage when typechecking from source vs. loading ModIfaces

2025-01-17 Thread ÉRDI Gergő
On Fri, 17 Jan 2025, Matthew Pickering wrote: 1. As Zubin points out we have recently been concerned with improving the memory usage of large module sessions (#25511, !13675, !13593) I imagine all these patches will greatly help the memory usage in your use case. I'll try these out and repor

Re: GHC memory usage when typechecking from source vs. loading ModIfaces

2025-01-17 Thread ÉRDI Gergő
On Fri, 17 Jan 2025, Zubin Duggal wrote: See https://gitlab.haskell.org/ghc/ghc/-/issues/25511 Thank you, reading this ticket and the linked PR, this looks EXACTLY related to what I'm seeing! Unfortunately, I can't just try it out quickly, because my code is currently based on GHC 9.8, but o

Re: GHC memory usage when typechecking from source vs. loading ModIfaces

2025-01-17 Thread Matthew Pickering
Hi Gergo, I think there a few things to say here. 1. As Zubin points out we have recently been concerned with improving the memory usage of large module sessions (#25511, !13675, !13593) I imagine all these patches will greatly help the memory usage in your use case. 2. You are absolutely right

Re: GHC memory usage when typechecking from source vs. loading ModIfaces

2025-01-17 Thread Zubin Duggal
See https://gitlab.haskell.org/ghc/ghc/-/issues/25511 On 25/01/17 08:54, Erdi, Gergo via ghc-devs wrote: PUBLIC Looking at this with ghc-debug, at least I can see why we have the huge memory usage when recreating ModDetails: there are lots of HscEnvs stored all over the heap (I assume in thun

RE: GHC memory usage when typechecking from source vs. loading ModIfaces

2025-01-17 Thread Erdi, Gergo via ghc-devs
PUBLIC Looking at this with ghc-debug, at least I can see why we have the huge memory usage when recreating ModDetails: there are lots of HscEnvs stored all over the heap (I assume in thunks inside already compiled modules), when I recreate the ModDetails and replace them in the HUG, I am accum