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

[validation] investigate highly increased memory consumption with new Java source reconciling #922

Closed
martinlippert opened this issue Dec 9, 2022 · 7 comments
Assignees
Labels
for: eclipse something that is specific for Eclipse for: vscode something that is specific for VSCode theme: performance theme: validation type: bug

Comments

@martinlippert
Copy link
Member

We are seeing a highly increased memory consumption when having the new Java source code reconciling enabled (as reported by various users).

@martinlippert martinlippert added type: bug status: needs-investigation for: eclipse something that is specific for Eclipse for: vscode something that is specific for VSCode theme: refactoring labels Dec 9, 2022
@martinlippert martinlippert added this to the 4.17.1.RELEASE milestone Dec 9, 2022
@martinlippert
Copy link
Member Author

I added a section to the user guide explaining the experimental nature of this and how to workaround this by deactivating the new Java source reconciling - to see if that makes a difference: https://github.com/spring-projects/sts4/wiki/Validations-And-Quick-Fixes#experimental-nature-of-this-new-feature-and-potential-side-effects

@martinlippert
Copy link
Member Author

The goal here is to analyze what exactly is causing this memory spikes and fix that. From what I've seen so far, it looks like the language server process uses a lot of memory, but it seems like this memory usage is not permanently, but reduced when a GC kicks in.

@martinlippert martinlippert changed the title [validations] investigate highly increased memory consumption with new Java source reconciling [validation] investigate highly increased memory consumption with new Java source reconciling Dec 11, 2022
@jan-z
Copy link

jan-z commented Dec 19, 2022

The language server process (BootLanguageServerBootApp) also uses a lot of CPU.

For me it uses about four cpu minutes every time I save any Java file.

I had to disable Java source reconciling to make Eclipse usable again.

@martinlippert
Copy link
Member Author

martinlippert commented Dec 19, 2022

As a summary of the things you can deactivate in order to avoid the high CPU usage and performance issues:

Go to Preferences -> Language Servers -> Spring Language Servers -> Spring Boot Language Server, then:

  • Deactivate Start Language Server at startup...
  • OpenRewrite -> deactivate Reconciling of Java sources
  • Spring Boot Version Validation, set Enablementto Off

In addition to that, feel free to also try the latest CI builds:https://dist.springsource.com/snapshot/STS4/nightly-distributions.html. The latest builds already include a few early steps to improve the overall performance behavior again.

@beatjost
Copy link

beatjost commented Jan 4, 2023

The Update 4.17.1 seems to solve the issue (also after undo the workaround). Thank you for the quick fix 👍

@martinlippert
Copy link
Member Author

Thanks @beatjost for letting us know, glad to hear this.

@BoykoAlex
Copy link
Contributor

I think in general this reconciling will take up memory. Parsing all sources in a project does take memory. The difference now is that it is batches of 50 sources at once and there is only one thread dedicated to project reconciling. Thus, I think memory usage peaks should be lower. This is in since 4.17.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: eclipse something that is specific for Eclipse for: vscode something that is specific for VSCode theme: performance theme: validation type: bug
Projects
None yet
Development

No branches or pull requests

4 participants