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

gopls: program used 23GB of RAM on my machine #34906

Closed
kevinburke1 opened this issue Oct 14, 2019 · 9 comments
Closed

gopls: program used 23GB of RAM on my machine #34906

kevinburke1 opened this issue Oct 14, 2019 · 9 comments
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.

Comments

@kevinburke1
Copy link

I recompiled x/tools at tip (539cdc4) today. I am also running Go tip (b649bdc).

I use gopls as part of vim-go, to edit Go files. I noticed my fans started spinning, opened Activity Monitor and noticed gopls using 23GB of memory.

I likely won't have cycles to figure out what is causing the memory leak today but hopefully this information is enough to figure out what/where the problem is.

@gopherbot gopherbot added the gopls Issues related to the Go language server, gopls. label Oct 14, 2019
@kevinburke1 kevinburke1 changed the title gopls memory leak gopls: program used 23GB of RAM on my machine Oct 14, 2019
@Gastove
Copy link

Gastove commented Oct 14, 2019

Seeing the same thing -- I updated gopls about an hour ago, and it only stops consuming memory when I run out of it (~30GB, in my case, at which point the whole system locks up).

@kevinburke1
Copy link
Author

version v0.1.6, built in $GOPATH mode

2019/10/14 15:39:34 Info:2019/10/14 15:39:34 Build info
----------
version v0.1.6, built in $GOPATH mode

Go info
-------
go version devel +4c9e757daf Mon Oct 14 16:13:27 2019 +0000 darwin/amd64

GO111MODULE="off"
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/kevin/Library/Caches/go-build"
GOENV="/Users/kevin/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GONOPROXY="github.com/meterup"
GONOSUMDB="github.com/meterup"
GOOS="darwin"
GOPATH="/Users/kevin"
GOPRIVATE="github.com/meterup"
GOPROXY="direct"
GOROOT="/Users/kevin/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/Users/kevin/go/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/s1/909yt58s4wj8h_7v7frr8rkm0000gn/T/go-build822850684=/tmp/go-build -gno-record-gcc-switches -fno-common"
2019/10/14 15:39:34 Info:2019/10/14 15:39:34 12.948224ms for GOROOT=/Users/kevin/go GOPATH=/Users/kevin GO111MODULE=off PWD=/Users/kevin go "env" "GOMOD", stderr: <<>>
2019/10/14 15:39:34 Info:2019/10/14 15:39:34 13.608131ms for GOROOT=/Users/kevin/go GOPATH=/Users/kevin GO111MODULE=off PWD=/Users/kevin go "list" "-m" "-json" "all", stderr: <<go list -m: not using modules
>>
2019/10/14 15:39:34 Info:2019/10/14 15:39:34 15.436484ms for GOROOT=/Users/kevin/go GOPATH=/Users/kevin GO111MODULE=off PWD=/Users/kevin go "list" "-e" "-json" "-compiled=true" "-test=true" "-export=false" "-deps=true" "-find=false" "--" "builtin", stderr: <<>>
gopls: getFile: file:///path/to/file.go: open /path/to/file.go: no such file or directory

I don't have time today to figure out how to enable logs. I just reverted x/tools by several commits and reinstalled.

@kevinburke1
Copy link
Author

I rolled back to 638914d and have not had any problems for the rest of the afternoon. Not clear whether one caused the other, though, it's possible that I haven't re-triggered the same behavior.

@try876
Copy link

try876 commented Oct 15, 2019

I think it was a problem introduced by revision b53505e, because I downgraded to revision 5fa5b17 and the problem disappeared.

@agnivade agnivade added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Oct 15, 2019
@golang golang deleted a comment from gopherbot Oct 15, 2019
@stamblerre
Copy link
Contributor

The fix will be coming shortly (CL 201098). Thank you for reporting and investigating this issue.

@stamblerre
Copy link
Contributor

Now that the CL has been merged, I will close this issue.

@kevinburke1
Copy link
Author

Thanks for the quick fix Rebecca - can confirm I haven't seen this since that CL was merged and I recompiled.

@t0mk
Copy link

t0mk commented Dec 19, 2019

in which release is this fix present?

@stamblerre
Copy link
Contributor

This fix is available in the current gopls release (v0.2.2).

@golang golang locked and limited conversation to collaborators Dec 18, 2020
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. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

7 participants