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: go list causes 100% CPU load #39116

Open
kzhui125 opened this issue May 17, 2020 · 4 comments
Open

x/tools/gopls: go list causes 100% CPU load #39116

kzhui125 opened this issue May 17, 2020 · 4 comments

Comments

@kzhui125
Copy link

@kzhui125 kzhui125 commented May 17, 2020

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

$ go version
go version go1.14 darwin/amd64

Does this issue reproduce with the latest release?

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN="/Users/zm/go/bin"
GOCACHE="/Users/zm/Library/Caches/go-build"
GOENV="/Users/zm/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/zm/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/Cellar/go/1.14/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.14/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/_6/z1bzbqfn1h9byyv41hn2qgvc0000gn/T/go-build488495920=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

I just use VSCode to edit go files.

What did you see instead?

I see the CPU fan is loud. then I see the "go" process use 100% CPU. After I quit VSCode, the "go" process still use 100% CPU. maybe the recent update of gopls is related?

1

Now I have force quit the "go" process, since the CPU fan is loud.

@ALTree ALTree changed the title go CPU 100% x/tools/gopls: go list causes 100% CPU load May 17, 2020
@gopherbot
Copy link

@gopherbot gopherbot commented May 17, 2020

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.

@gopherbot gopherbot added this to the Unreleased milestone May 17, 2020
@ALTree
Copy link
Member

@ALTree ALTree commented May 17, 2020

You didn't write so, but I'm guessing you're using the go lsp? And that go list invocation is from gopls? maybe @stamblerre can tell.

EDIT: oh sorry, you did write you updated gopls. I tagged this correctly then.

@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented May 18, 2020

@kzhui125: Are you using modules or GOPATH mode? What was the root directory you opened gopls with? Can you run go list -e -json -compiled=true -test=true -export=false -deps=true --find=false -- fmt from the command line? Does it exit normally or does it print any errors?

@kzhui125
Copy link
Author

@kzhui125 kzhui125 commented May 18, 2020

I opened two VSCode windows (two small repos). One use go modules, another one only has one go file, didn't run "go mod init" yet.

When I run go list -e -json -compiled=true -test=true -export=false -deps=true --find=false -- fmt on the two repos, both exit normally and quicklly.

I will see if I meet this issue again in the future. Thanks.

@stamblerre stamblerre modified the milestones: Unreleased, gopls/v0.5.0 May 26, 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
4 participants
You can’t perform that action at this time.