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: significant memory usage in kubernetes/vendor/k8s.io/client-go #40651
Comments
Thanks for the report, @microyahoo. @heschik has been working on improving |
The situation looks good to me at |
can confirm that using master solves a lot of memory growth issues 👍 |
@heschik Thanks for your quick response, I have try it, seems it still keeps large memory usage as below.
I'm confused if I open the other repo like etcd, the memory usage is stable in 2.2G, but if I open kubernetes/vendor/k8s.io/client-go, the memory will be run out quickly.
|
None of your commands actually show the memory usage of gopls, so I'm not sure what I'm supposed to be looking at here. When gopls uses a lot of memory, it writes debugging information to |
Hi @heschik , I'm really sorry for my late reply. I have attached the log, please do not hesitate to contact me in case of any query. |
You said that you opened the client-go directory, but the zip file that you uploaded looks more like it's dealing with all of Kubernetes. Can you confirm which directory you're opening? Kubernetes is a huge project and unfortunately it's going to use a lot of memory. https://golang.org/cl/248180 will help a tiny bit if you download the very latest master, but right now I don't see any big surprises. We will continue to pay attention to memory usage but I don't think things are going to get much better right now. |
Thanks for your analysis. The client-go is underneath the Kubernetes project. |
The directory you open as the workspace directory in VS Code defines the project that gopls will load and analyze. You appear to be opening the top-level Kubernetes directory as your workspace; if you open the client-go directory instead, gopls will use much less memory. If you have any further questions please update to the latest master, and include both a fresh memory debug zip and the gopls server logs, as described in https://github.com/golang/tools/blob/master/gopls/doc/troubleshooting.md#capturing-logs. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
it can be reproduced in my VMWare centos.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I just opend the client-go directory, the memory usage will be increased dramatically, after a while, it will be fixed at a certain value, in my os, about 6G. I'm not sure whether the symbolic link affect the gopls, because in k8s vendor directory, it's a link to staging directory.
The memory usage comes to normal after stop gopls
What did you expect to see?
Keep memory utilization at a low level when using gopls.
What did you see instead?
the memory usage increase dramtically.
The text was updated successfully, but these errors were encountered: