Skip to content

Memory usage #802

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

Closed
adamConnerSax opened this issue Feb 11, 2020 · 16 comments
Closed

Memory usage #802

adamConnerSax opened this issue Feb 11, 2020 · 16 comments
Labels
performance Issues about memory consumption, responsiveness, etc. type: enhancement New feature or request

Comments

@adamConnerSax
Copy link

I know versions of this have been reported before but I thought this might be a useful data point and maybe a way for me to get things to try...
I'm using ghcide-0.1.0.0, with ghc-8.6.5, from emacs (with recent versions of hie-bios and haskell-lsp) on Mac OSX 10.15.3.
It works fine but memory usage (of ghcide) starts at about 5GB, grows fast and eventually (an hour of editing a few files in the project) makes things too slow. So I kill it and then emacs asks me to restart and it all works fine for a while.
One observation: I was using ghcide 0.0.6 and the same thing would happen but much more slowly. I'd maybe restart once a day instead of once an hour.
Anything I can try to improve this or help debug it?

@mpickering
Copy link
Contributor

@adamConnerSax You want to save your bug report until the work on haskell/ghcide#355 is resolved. Perhaps you can try out that branch?

@adamConnerSax
Copy link
Author

adamConnerSax commented Feb 11, 2020

Does it work with 8.6.5? Then I'd be happy to. But I am stuck with a dependency that I can't use with 8.8.
I looked at that issue/branch and somehow thought it was 8.8 only.

@mpickering
Copy link
Contributor

There is a branch which works with 8.6.5 which I am planning to work on a bit more tonight.

@adamConnerSax
Copy link
Author

If you point me to a commit/branch, I'm happy to try!

@mpickering
Copy link
Contributor

@adamConnerSax
Copy link
Author

adamConnerSax commented Feb 11, 2020

That's working! And holding at about 2.7GB. I can't always tell if all the features are working...sometimes I get the little window in the upper left with definitions and sometimes I don't, but that was true before as well, I think.
Spoke too soon. Also growing as I open more files in emacs. But more slowly for sure.

@mpickering
Copy link
Contributor

@adamConnerSax In the current design no results of shake rules are ever garbage collected, so over the course of run then it will leak memory. The branch should definitely use less memory overall though, especially on subsequent runs once the interface files have been created.

@LukaHorvat
Copy link

@mpickering Is that branch merged somewhere now or should I still use it if I want to test it?

@pepeiborra
Copy link
Collaborator

Yes it is, merged to master

@mpardalos
Copy link
Contributor

We've spoken with @mpickering about working on this as part of my GSoC project. We would need to add some kind of garbage collection scheme for the results of the Shake rules.

Would something simple like removing all entries relating to a file when it is closed work?
Also, would performance regressions relating to this kind of change show up in the benchmarks?

@jneira
Copy link
Member

jneira commented Sep 24, 2020

@mpardalos hi! anything of interest about this issue? could it be closed?

@mpardalos
Copy link
Contributor

I was actually planning to start work on this. It's still very much an issue. It should stay open.

@pepeiborra pepeiborra transferred this issue from haskell/ghcide Jan 1, 2021
@jneira jneira added type: enhancement New feature or request performance Issues about memory consumption, responsiveness, etc. labels Jan 11, 2021
@jneira
Copy link
Member

jneira commented Jan 11, 2021

@mpardalos dont want to bother you too much but gsoc has finished some time ago afaik: do you have some additional insights about this issue? thanks 🙂

@mpardalos
Copy link
Contributor

@jneira my GSoC time ended before I had a chance to address this memory leak, however, I had done work on identifying what exactly was causing the memory leak that was merged into ghcide as haskell/ghcide#922, and that should help in finding a fix

I have discussed some findings in haskell/ghcide#826 (which ended up becoming haskell/ghcide#922) that you might find useful.

@jneira
Copy link
Member

jneira commented Nov 21, 2021

not sure if last changes around performance in hls 1.5.0 would affect this

@jneira
Copy link
Member

jneira commented Nov 26, 2021

@adamConnerSax hi, there had been lot of changes since the issue and we have newer issues about memory usage, so i am gonna close this one. If you continue expriencing excessive memory usage with the last hls version feel free to comment in any of the newer memory issues or open a new one if no one match your observations

@jneira jneira closed this as completed Nov 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Issues about memory consumption, responsiveness, etc. type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants