x/tools/gopls: high memory usage in sigs.k8s.io/cluster-api #37076
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. |
Is this with "go.languageServerFlags": [
"-rpc.trace",
"serve",
"--debug=localhost:6060"
] and running I just tried typing quickly in a random file in that repo, and I could push memory usage up pretty high, but it all went back down after a GC. |
Also, if you could provide the output of |
I'm running with gopls v0.3.0, go 1.13.3, vscode on Ubuntu 18.04 and seeing memory usage growing to 10GB within a few minutes. Happens when editing some files but not others. pprof profile attached. Unfortunately this is private code so I can't share it. The repo is quite large, maybe 60k lines not including vendor stuff, but the package I'm working on has fewer than 1,000 lines. I can make edits for about 10 minutes before my system hard freezes and I have to power cycle. Workaround is to kill gopls every few minutes. This is new in v0.3.0. I can't remember what version I was running before upgrading a couple days ago, but the issue wasn't this severe. pprof.gopls.alloc_objects.alloc_space.inuse_objects.inuse_space.001.pb.gz |
@cbd32: |
@stamblerre I tried both on v0.3.1 and the master version of |
@cbd32 I looked at your profile and I don't see any obvious signs of the autocomplete memory leak, but it'd still be good to rule it out. Once you've reproduced with v0.3.1, please file a new issue so that we can keep separate problems from getting confused with each other. @vincepri I was also unable to reproduce your issue. I did notice that |
All: I just merged https://golang.org/cl/218858, which will automatically write profiles when gopls uses more than 5GiB of memory. If you'd like, you can update to master with |
Thanks @heschik, I'll post them here if I encounter the issue again |
I'm using .0.3.1 and with a modest size codebase (dexidp) my copy of nvim / vim-go / gopls starts at about 40MB of ram. Within a minute gopls is consuming almost 2GB of RAM. A second nvim session will lock my machine on the same code base as memory usage climbs to about 95% of available RAM before my machine starts swapping with a vengence. This is on linux 5.4.15. |
@jvburnes Loading stuff takes time, so I'm not sure what you mean by it starting at 40MiB. When I open https://github.com/dexidp/dex, I see |
thanks hescik. I just reproduced it in my VM. It's getting late, but my VM was consuming about 768M in the guest and very stable. I started nvim within one of the dex source files and within a minute all available VM memory was consumed (about 3GB) -- right before it crashed my VM. I know you want details and they will be forthcoming. It's getting late so I'll post them in the morning. |
@heschik has made a few fixes on master that should address the memory consumption issues, so I would recommend upgrading to master ( |
I think we can close this for |
Thanks for following up! Closing. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Running
VSCode
with latestgopls
developing with Cluster API, a Kubernetes sub-project.What did you expect to see?
Reasonable memory usage in Activity Monitor.
What did you see instead?
gopls
process that was attached tocluster-api
codebase was about 30GB after developing on the codebase.The text was updated successfully, but these errors were encountered: