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: high memory consumption #45404

Open
EgorRzh opened this issue Apr 6, 2021 · 1 comment
Open

x/tools/gopls: high memory consumption #45404

EgorRzh opened this issue Apr 6, 2021 · 1 comment

Comments

@EgorRzh
Copy link

@EgorRzh EgorRzh commented Apr 6, 2021

What version of Go are you using (go version)?

1.16

$ go version

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

Ubuntu 20.04

go env Output
$ go env

GO111MODULE="off"
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/egor/.cache/go-build"
GOENV="/home/egor/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/egor/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/egor/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.16"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build638460739=/tmp/go-build -gno-record-gcc-switches"

What did you do?

I'am starting VSCode with installed Go extension. And gopls process use all memory (24Gb)

What did you expect to see?

What did you see instead?

Attached file with gopls logs

gopls.9316-14GiB-nonames.zip

@EgorRzh EgorRzh changed the title x/tools/gopls: <fill this in> x/tools/gopls: A lot of memory consumption Apr 6, 2021
@gopherbot gopherbot added this to the Unreleased milestone Apr 6, 2021
@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented Apr 6, 2021

Thank you for filing this issue and attaching the memory zip. Based on the heap profile, we think that a package in your workspace might have really large byte slice literals, which are known to take up a lot of memory in the type checker. Is that possible? You can look at the heap profile with package names to identify which package that might be.

@stamblerre stamblerre changed the title x/tools/gopls: A lot of memory consumption x/tools/gopls: high memory consumption Apr 6, 2021
@stamblerre stamblerre changed the title x/tools/gopls: high memory consumption x/tools/gopls: high memory consumption Apr 6, 2021
@stamblerre stamblerre modified the milestones: Unreleased, gopls/unplanned Apr 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants