Skip to content
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: gopls seems to be leaking memory on macOS Big Sur #42342

Closed
milosgajdos opened this issue Nov 2, 2020 · 3 comments
Closed

x/tools/gopls: gopls seems to be leaking memory on macOS Big Sur #42342

milosgajdos opened this issue Nov 2, 2020 · 3 comments
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@milosgajdos
Copy link

What did you do?

When working with large codebases gopls seems to be consuming unhealthy amount of memory

Screenshot 2020-11-02 at 17 18 13

this leads to the point that my os is prompting me to force quit the terminal app.

What did you expect to see?

Less memory usage.

What did you see instead?

Excessive amount of memory used by gopls

Build info

# redacted
$ go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOOS="darwin"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/Cellar/go/1.15.3/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.15.3/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/2q/5_4ntfd5369552_qb4_plfz40000gn/T/go-build998481377=/tmp/go-build -gno-record-gcc-switches -fno-common"
golang.org/x/tools/gopls v0.5.1
    golang.org/x/tools/gopls@v0.5.1 h1:AF3Uh7HF08SZpKFfgJO6zfF3bbxyDXWqdkK4kMXiQ1o=
    github.com/BurntSushi/toml@v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
    github.com/google/go-cmp@v0.5.1 h1:JFrFEBb2xKufg6XkJsJr+WbKb4FQlURi5RUcBveYu9k=
    github.com/sergi/go-diff@v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
    golang.org/x/mod@v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4=
    golang.org/x/sync@v0.0.0-20200625203802-6e8e738ad208 h1:qwRHBd0NqMbJxfbotnDhm2ByMI1Shq4Y6oRJo21SGJA=
    golang.org/x/tools@v0.0.0-20200930165741-f1523d29dbb9 h1:1R38tQp22dcHpTKJPjgVa16FhlDy/kHEaCM/ndi/FIc=
    golang.org/x/xerrors@v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
    honnef.co/go/tools@v0.0.1-2020.1.5 h1:nI5egYTGJakVyOryqLs1cQO5dO0ksin5XXs2pspk75k=
    mvdan.cc/gofumpt@v0.0.0-20200802201014-ab5a8192947d h1:t8TAw9WgTLghti7RYkpPmqk4JtQ3+wcP5GgZqgWeWLQ=
    mvdan.cc/xurls/v2@v2.2.0 h1:NSZPykBXJFCetGZykLAxaL6SIpvbVy/UFEniIfHAa8A=
@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Nov 2, 2020
@gopherbot gopherbot added this to the Unreleased milestone Nov 2, 2020
@stamblerre
Copy link
Contributor

Can you please follow the memory usage troubleshooting steps and share the memory debug information?

Also, it looks like you have 5 gopls processes running--do you have 5 editors open or just one?
By the way, the latest version of gopls is v0.5.2--please update by running GO111MODULE=on go get golang.org/x/tools/gopls@latest.

@stamblerre stamblerre added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Nov 2, 2020
@stamblerre stamblerre modified the milestones: Unreleased, gopls/vscode-go Nov 2, 2020
@milosgajdos
Copy link
Author

Occasionally I might have few instances of different editors opened, yes. Unfortunately, that's necessary due to my work. I shall update gopls and grab the memory debug info soon.

@stamblerre stamblerre added this to In progress in vscode-go: gopls by default Nov 10, 2020
@milosgajdos
Copy link
Author

I have not noticed anything weird going on since the last macOS release candidate so I'm closing this. Thanks.

vscode-go: gopls by default automation moved this from In progress to Done Nov 16, 2020
@stamblerre stamblerre removed this from the gopls/vscode-go milestone Nov 16, 2020
@golang golang locked and limited conversation to collaborators Nov 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
No open projects
Development

No branches or pull requests

3 participants