-
-
Notifications
You must be signed in to change notification settings - Fork 367
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix space leak on cradle reloads #1316
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Now that the |
But hiedb doesn't index build depends, does it? |
Ah, right. I misread the PR and thought it was for the project local exports map. However, we could still index and persist a export map for dependent packages, by indexing the exports directly from the ModIface instead of the |
This is necessary to prevent leaking the package exports
Expensive and already covered by 'code actions after cradle edit'
This was missing from the list
This fixes the th-linking-test because it restores the previous dynamic semantics in which the package exports are only evaluated when code actions are requested.
6c6b4f7
to
4176f9f
Compare
All the tests pass now, but the benchmark run on master (where the leak is still present) times out. I'll wait for the speed ups in #1315 to land |
That's how the exports map works now, except that it isn't persisted. Do you think that persisting would be worth the effort? I think that's a nice idea, please file an issue! |
We were leaking 'PackageExports' values for all past 'HscEnv's.
Fixed by moving the package exports inside the 'HscEnvEq'.
I have also added two experiments to characterise the leak, the main one is 'code actions after cradle edit'. On the Cabal 3 example, this is what the experiment looks like: