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
x/tools/gopls: re-initialize workspace when the go binary changes #49883
Comments
Possibly related: #49035, though my expectation was that this only affected the high-water mark (that may also be the case here; it is more concerning if the steady-state memory is significantly higher). Thanks for the repro, and the profiles. |
One more thing, I have generally pretty generic VSCode settings, but I do have |
Ok, this is interesting. Looking at your 19GB.withNames heap profile, things are not as I would have expected:
Half of the heap is allocated in expandErrors. I checked recent heap dumps of my own gopls, and don't see anything similar. It seems likely that we either have a memory leak, or there were a tremendous amount of errors in memory at the high-water mark. I will try to reproduce with your repo, but any additional clues you might have would be useful. @heschi might also find this interesting... |
Few days after this behavior started and was persistent (like, even once gopls got killed, the new instance quickly degraded into the same behavior) it stopped. I do not know why. Maybe it is connected with the state of the editors and code in the editors at that particular moment, so after I continued working (or, tried to work, given instability) and closed tabs and stuff, it seems it is gone. So sadly I cannot provide more input into this. Maybe it is connected with the fact that I had VScode running first with old go version and then I upgraded go while VScode and all tabs were left open. Maybe this confused it? |
Thanks for the follow-up. I suppose it's theoretically possible that upgrading the Go command led to an explosion in errors, due to some sort of Unfortunately tracking this down is probably not worthwhile, but we should perhaps reinitialize gopls if ever we detect that the Go binary has changed. |
Sounds good. |
Is reinitializing |
This is unfortunately a relatively low priority, so moving it to unplanned while we focus on 1.18 support. |
What did you do?
I have been developing a library using Go 1.16 and everything was working fine. Then I decided to upgrade Go on my system to 1.17.3 and use it to continue developing the library. But gopls started consuming a lot of memory, to the amount that it gets killed by OOM. Then Vscode restarts it and everything starts again.
Build info
gopls.1781385-16GiB-withnames.zip
gopls.1771302-17GiB-withnames.zip
gopls.1753381-19GiB-withnames.zip
The text was updated successfully, but these errors were encountered: