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: reduce memory usage #36943

Open
stamblerre opened this issue Jan 31, 2020 · 16 comments
Open

x/tools/gopls: reduce memory usage #36943

stamblerre opened this issue Jan 31, 2020 · 16 comments

Comments

@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented Jan 31, 2020

This is a general tracking issue for memory usage in gopls. We need to collect data and set goals for usage for a given project size. We also need to work towards reducing the memory usage when staticcheck is enabled (though that may be a separate issue).

If you have a specific problem with gopls using too much memory on your machine, please create a new issue so that we can investigate it separately.

Please include your editor settings and memory debug information with your issue. These are automatically written to the temporary directory (/tmp for Unixes) with names like gopls.1234-5GiB-withnames.zip. If you are uncomfortable sharing the package names of your code, you can share the -nonames zip instead.

@mnrce

This comment was marked as resolved.

@patrikeh

This comment was marked as resolved.

@guiguan

This comment was marked as resolved.

@myitcv

This comment was marked as resolved.

@stamblerre

This comment was marked as resolved.

@vincepri

This comment was marked as resolved.

@heschik

This comment was marked as resolved.

@trajber

This comment was marked as resolved.

@heschik

This comment was marked as resolved.

@Jacalz

This comment was marked as resolved.

@stamblerre

This comment was marked as resolved.

@gopherbot
Copy link

@gopherbot gopherbot commented Jun 4, 2020

Change https://golang.org/cl/236397 mentions this issue: internal/lsp/cache: intermediate test variants aren't workspace packages

gopherbot pushed a commit to golang/tools that referenced this issue Jun 11, 2020
When you write a test in (say) the fmt package, you get a test variant
augmented with the test files. In many cases you also get test variants
of the things the fmt package depends on. The primary test variant,
(fmt [fmt.test]) is interesting to us, because it contains the tests.
But the intermediate variants (testing [fmt.test]) aren't -- the user
can only get to them indirectly. We certainly don't need to fully parse
them.

Treat intermediate test variants as non-workspace packages. This doesn't
accomplish much yet but paves the way for later optimizations.

Updates golang/go#36943.

Change-Id: I1a20abcd2d67767f07132a75a20f098be6f19a76
Reviewed-on: https://go-review.googlesource.com/c/tools/+/236397
Run-TryBot: Heschi Kreinick <heschi@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
@heschik
Copy link
Contributor

@heschik heschik commented Jun 11, 2020

I think the commits I pushed today have improved things significantly for large projects. I'll keep looking for a little bit.

@itzmanish

This comment was marked as resolved.

@stamblerre stamblerre modified the milestones: gopls/v0.7.0, gopls/v0.5.0 Jun 26, 2020
@heschik
Copy link
Contributor

@heschik heschik commented Jul 1, 2020

From the first comment:

If you have a specific problem with gopls using too much memory on your machine, please create a new issue so that we can investigate it separately.

There will be zip files in /tmp with additional memory diagnostic information. Please include one of them. If you are uncomfortable sharing the package names of your code you can pick one with a -nonames suffix, otherwise please upload a --withnames` file.

@stamblerre
Copy link
Contributor Author

@stamblerre stamblerre commented Aug 12, 2020

There have been a number of memory improvements in gopls at master. Please try out with the instructions on https://github.com/golang/tools/blob/master/gopls/doc/user.md#unstable-versions, or wait for the next release.

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
You can’t perform that action at this time.