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: expensive `go list` process on startup #40530

Closed
GAZ082 opened this issue Aug 2, 2020 · 3 comments
Closed

x/tools/gopls: expensive `go list` process on startup #40530

GAZ082 opened this issue Aug 2, 2020 · 3 comments

Comments

@GAZ082
Copy link

@GAZ082 GAZ082 commented Aug 2, 2020

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

go version go1.14.6 linux/amd64

Does this issue reproduce with the latest release?

Yes.

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

go env Output
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/gabriel/.cache/go-build"
GOENV="/home/gabriel/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GONOPROXY="github.com/GAZ082/*"
GONOSUMDB="github.com/GAZ082/*"
GOOS="linux"
GOPATH="/home/gabriel/go"
GOPRIVATE="github.com/GAZ082/*"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/lib/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
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-build770371537=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Hi. I open a project and after gopls loads for some reason the process "go -list" start to consume a lot of CPU and memory. I kill the go process and restart the language server and again starts to consume CPU and mem. If I leave it alone it may very well fill up my 16 GB of ram.
Check gif:

gocrazy

What did you expect to see?

Not a go process running rogue, that's for sure.

What did you see instead?

A rogue go process!

@gopherbot gopherbot added the gopls label Aug 2, 2020
@stamblerre stamblerre changed the title "go -list" memory leak after gopls is loaded. x/tools/gopls: expensive `go list` process on startup Aug 4, 2020
@gopherbot gopherbot added the Tools label Aug 4, 2020
@gopherbot gopherbot added this to the Unreleased milestone Aug 4, 2020
@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented Aug 4, 2020

@GAZ082: Are you opening gopls at the root of a very large module? The go list call on startup is used to load all of the code in your workspace, so it's likely to be expensive if there are a lot of packages there. If you are working in a public repository, can you please share a repro case?

@stamblerre stamblerre modified the milestones: Unreleased, gopls/v.0.4.5 Aug 4, 2020
@GAZ082
Copy link
Author

@GAZ082 GAZ082 commented Aug 4, 2020

@GAZ082: Are you opening gopls at the root of a very large module? The go list call on startup is used to load all of the code in your workspace, so it's likely to be expensive if there are a lot of packages there. If you are working in a public repository, can you please share a repro case?

Thanks Reb, I'll double check and get back to you.

@GAZ082
Copy link
Author

@GAZ082 GAZ082 commented Aug 9, 2020

Cant replicate. Will close. Thanks!

@GAZ082 GAZ082 closed this Aug 9, 2020
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
You can’t perform that action at this time.