-
Notifications
You must be signed in to change notification settings - Fork 206
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
STS 4 high cpu and ram usage when Code Mining and Live Boot Hint Decorators are both enabled in Windows 10 #292
Comments
database-demo.zip |
It seems like the Code Mining feature and the Live Boot Hint Detectors are messing each other up in an infinite loop. Disable one or the other and everything runs normally. |
Was able to reproduce the high CPU usage. As soon as I opened I think this probably comes from the fact that in STS the live information we display in code lenses is 'dynamic' and it gets refreshed every 5 seconds. The refreshes we trigger probably somehow also causes the codeminings to refresh. I see that codeminings is showing over 2000 references for the 'logger' field. So I imagine this might be part of the reason why the codeminings are a bit CPU intensive in finding all those references. This is all bit speculative at this point, so I'll have to try and analyze it more. |
Opening more files causes pretty much constant high CPU. |
...nothing has changed. The refresh can be very expensive if user has enabled code minings. See: #292
I've pushed something that avoid the CPU spikes simply by checking whether the highlights/codelenses from our language server have changed since last time. When they haven't changed we don't trigger a refresh and this totally avoids the periodic CPU spikes. There's a few more things we might be able to do to also improve the case where the refresh does actually get executed. @BoykoAlex is exploring this a bit at the moment. |
@tparry3 The changes I pushed out have already made their way through the build pipeline. You can try it out by downloading a snapshot/nightly STS 4 distribution from here: http://dist.springsource.com/snapshot/STS4/nightly-distributions.html |
(comment in Pivotal Tracker added by Alex Boyko:) I have pushed the fix for not updating CMs when CodeLens for Live Beans setting is off. We are waiting for feedback from the bug raiser now I think. |
(comment in Pivotal Tracker added by Martin Lippert:) I tested this with the latest nightly CI build and it looks to me like there is a fundamental issue. I used a fresh, vanilla STS 4.2.2 CI build and imported the project, then enabled the general code minings from Eclipse, but nothing shows up in the editor. As soon as I add the actuators to the app and start it, so that the live hovers are triggered, those live hovers show up, including their code minings, together with the JDT code minings. Stopping the app thereafter removes the live hovers, but keeps the JDT code minings showing. We need to fix this. The JDT code minings should always work, independent of the Boot LS code minings showing up or not. Maybe there is something going wrong with our additional "enable code minings in editors automatically" implementation. |
I agree. JDT code minings are independent of the Boot LS code minings. Also, I pulled the nightly build from last night. The Preferences screen for 'Spring Boot Language Server' is completely blank for me. No options showing. No text at all. Just a blank pane. |
@tparry3 Spring Boot Language Server page is blank (for the moment) because its content has been moved to two sub-nodes: Boot Java and XML pages: |
(comment in Pivotal Tracker added by Alex Boyko:) @mlippert I enabled CMs under Java->Editor ->Code Minings opens Main class of Pe Clinic and i see |
(comment in Pivotal Tracker added by Alex Boyko:) Close/Open editor and they'll start showing up if they don't show for already opened editors. I don't think it's a problem with Boot LS Code Lens vs JDT Code Minings. It's rather Java CMs update problem. They show up with Boot LS CMs because receiving Boot LS Code Lense triggers CMs refresh and all of them show up: JDT and ours. |
I agree, doesn't seem like that's our problem. If JDT code minings don't appear when you just enable JDT code minings from JDT preferences... seems like that's JDT's problem/bug. It shouldn't be up to us to trigger a code mining refresh when nothing related to our own code minings has changed. In fact to avoid the CPU spikes, our efforts in addressing this ticket has been towards avoiding these refreshes as much as possible. |
(comment in Pivotal Tracker added by Martin Lippert:) I have a regular Java project (non-boot) in my workspace and re-opening the java editor with java editor code minings enabled shows the minings ( However, all this is in a plain Eclipse 2019-03 install. The latest STS4 CI doesn't behave the same. Once I switched the code minings off once, they never come back in a java editor. Are you sure we don't interfere with that mechanism? |
(comment in Pivotal Tracker added by Martin Lippert:) This works in the STS 4.2.1 release, too, but not in the latest STS 4.2.2 nightly, both on Eclipse 2019-03. Here is what I do:
In Eclipse 2019-03 and STS 4.2.1, the reference minings appear again after a short while, in STS 4.2.2 CI, they don't. |
I'm not 100% sure we are not responsible for this problem. However, this:
That sort of make perfect sense since the 'CPU spike fix' means we do no longer trigger a code minings refreshe every 5 seconds unless something changed in terms of our own code miniings. In the old version every 5 seconds we trigger a refresh, no matter what. |
I just tried latest CI build and if I do the steps as described... the code minings do come back for me in the last step. Everything else behaves as you describe. (So the code minings do not come back immediately when I re-enable them). Also I do not have to open/close the editor. Making a change in the editor by typing in it also brings code minings back. |
In STS 4 there is constant, high cpu usage along with large amounts of memory used when Code Mining is enabled along with Live Boot Hint Decorators for certain spring boot projects. I have a very small project that can reproduce it with released STS 4 (or Eclipse with STS 4 plugin) on Windows 10. Nightly builds of both show the same pattern.
Steps to reproduce:
Windows 10 - fully patched
STS 4 (or latest Eclipse with STS 4 plugin)
STS configured to run with Java 1.8 JRE with tools.jar added to the lib directory or Open JDK 11
Enable Code Mining
Enable Live Boot Hint Decorators
Import the uploaded database-demo project archive
Open all three java files in the IDE:
DatabaseDemoApplication.java
PersonJdbcDAO.java
Person.java
The text was updated successfully, but these errors were encountered: