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: using 1GB RAM with Mattermost server #38903
Comments
Thank you for filing a gopls issue! Please take a look at the Troubleshooting guide, and make sure that you have provided all of the relevant information here. |
If you are using Edit: Sorry, I see you are using v0.4.0. Is this on a public or private repository? If it's public, do you mind sharing a link to it? |
The repository is the Mattermost server. Here is a heap profile file (I hope!): gopls.149275-1GiB-heap.pb.gz
|
Thank you for sharing this. It looks as we'd expect, with most of the memory allocated during type checking. By the way, it looks like this heap is only 1GiB, not 16 as you saw. What are your Thank you for sharing the link to the repository - we'll try to reproduce. There are number of repos that seem to cause problems with |
@stamblerre Thank you so much for looking into it! Much appreciated. Yes, it's not the one that generated it. I fiddled a little with dependencies and now I only have the version that
I do not think so, at least not explicitly. It might be turned on by default in |
Thank you!
I don't believe vim-go turns on staticcheck by default, and based on the profile you attached that seems to be the case. We'll follow up here when someone from the gopls team has a chance to take a closer look. |
Here's another heap, under |
@ygworldr I believe some changes I landed today have improved memory usage on large projects substantially. Could you try |
@heschik I updated the version I have and opened two files in the Mattermost project:
I am afraid there was no heap file in |
That looks like pretty good success, no? Your most recent report was 1.3G, and now it's down to 970M. Not a bad improvement. The heaps are only generated once gopls crosses 1G so you won't have any yet. I'm inclined to close this -- I don't see any sign that there's a specific problem with mattermost, and we've made significant progress since it was filed. Do you agree? |
...assuming it doesn't grow up to 4 or 5 G again. |
@heschik
Yes, I think the improvements are great! Thank you so much for that. Your hard work is much appreciated! |
@heschik, I am afraid I have some bad news… But they are not more than 3G so, maybe not so bad? |
That's disappointing. Some progress but we should be able to do better. I added a new diagnostics section to the debug server that may be helpful. If you follow the troubleshooting guide to start it, |
No worries whatsoever. I am really grateful for the work you are doing.
I shall do as soon as is feasible. |
Sadly, the log file is empty. The server command looks like: What am I doing wrong here? |
There have been a number of memory improvements in |
@stamblerre I have updated just been doing lots of DevOps stuff and not much coding. This will change soon and I shall update. Thank you for your hard work! |
Closing, as this has been in the WaitingForInfo state for over a month. gopls/v0.5.0 has been released, and it contains these memory improvements. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Unknown.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Running
gopls
as part of vim-go. This is is one go file open.What did you expect to see?
A small increase in memory.
What did you see instead?
I have to constantly close/open neovim since otherwise, my machine dies because
gopls
takes all the 16G of RAM I have.The text was updated successfully, but these errors were encountered: