-
Notifications
You must be signed in to change notification settings - Fork 440
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
Latest vscode extension causes massive spike in CPU usage even when idle #2734
Comments
Are you able to share the sample project that was used when this happened ? Was it a Maven, Gradle, or un-managed project. |
I had no project. It was simply an upgrade of the extension that caused this. Disabling the extension fixed the issue. But what I did notice was that the java updater was running in the background for some reason. I don't have any auto-update enabled or anything, so I don't know why this was running. I killed the java update service and the problem persisted, so kept trying to figure out what changed in my system. Then I quit vscode and the cpu spike went down, so I opened up vscode again and started looking at the dates of the last updates of my extensions and noticed the java redhat extension was updated on Oct 11, so I disabled it, and then the problem went away.
On Wednesday, October 12, 2022 at 09:24:34 AM EDT, Roland Grunberg ***@***.***> wrote:
Are you able to share the sample project that was used when this happened ? Was it a Maven, Gradle, or un-managed project.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
@u84six Could you try to add
to your settings.json? |
I can't reproduce the issue? |
I'm not sure how a screenshot of my extension view is going to help, but here it is:
On Wednesday, October 12, 2022 at 07:56:28 PM EDT, Snjeza ***@***.***> wrote:
I can't reproduce the issue?
@u84six Could you show your Extension view?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
I suppose VS Code hasn't finished updating Java LS.
In this case, VS Code doesn't start Java LS, but will try to update it. |
I didn't know that Java runtime was embedded in vscode extension. So that explains the fans kicking in like crazy. I'm surprised that there's no indicator of that happening. The extension itself didn't show anything about an update that seemed to go on for a long time. I mean, my fans were at full force for a couple hours until I killed the process and disabled the extension.
On Thursday, October 13, 2022 at 02:47:40 PM EDT, Snjeza ***@***.***> wrote:
I'm not sure how a screenshot of my extension view is going to help, but here it is:
I suppose VS Code hasn't finished updating Java LS.
I had no project.
In this case, VS Code doesn't start Java LS, but will try to update it.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
@u84six You can add
to your setting.json. |
How long is this going to last? Now that we kind of know what this is, I decided to let it do its thing. But it has been hours, and my laptop is getting really hot, fans keep spinning, and in Task Manager, I see "OpenJDK Platform binary" pinning the CPU because of its network activity. Do you know why OpenJDK is updating? I didn't know that an extension could actually trigger a Java update. I installed OpenJDK manually and not because of the vscode Java extension.
On Thursday, October 13, 2022 at 05:08:03 PM EDT, Snjeza ***@***.***> wrote:
@u84six You can add
"update.enableWindowsBackgroundUpdates": false,
to your setting.json.
It will disable background updates.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
I think I have no choice other than disabling the Java extension. It's just taking too long. I don't know what it's doing, but it just continues to cause network activity (probably doing some type of update but I don't even know if it's working behind company firewall) which pins the CPU. It's practically melting my keyboard. I can't keep my hands on my keyboard for too long because it gets so hot! :)
On Thursday, October 13, 2022 at 05:08:03 PM EDT, Snjeza ***@***.***> wrote:
@u84six You can add
"update.enableWindowsBackgroundUpdates": false,
to your setting.json.
It will disable background updates.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
For the "OpenJDK Platform binary" processes in your task manager, is it possible to look at their properties/details or even the "command line" tab and tell us what arguments are being passed to this Java process ? It may give us a better idea of whether these are processes started by vscode-java or something else. |
I will get you this info soon. For now, I need to disable it so I can get some work done. But I do know that the "OpenJDK Platform binary" process doesn't start unless I enable the extension. If I disable the Java Redhat extension, the process ends and is removed from the task manager.
On Friday, October 14, 2022 at 04:03:22 PM EDT, Roland Grunberg ***@***.***> wrote:
For the "OpenJDK Platform binary" processes in your task manager, is it possible to look at their properties/details or even the "command line" tab and tell us what arguments are being passed to this Java process ? It may give us a better idea of whether these are processes started by vscode-java or something else.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
It depends on your Internet connection. It lasts less than 1 minute on my machine (4-5mb/sec). |
I have started facing similar issue very recently, will check if disabling the extension helps in my case. |
Hi, guys. |
I guess I find the reason. The extension Ltex, which help you do gammer/spell check that activate java.exe. By enabling it, java.exe is no longer awakened when writng latex. Apparently there is some bugs in Ltex. .... |
I am see this same issue, where Though this happens only when I open a specific file which is like a large Base class. On CMD + hovering on any variable within that file, vscode just shows Issue doesnt go away even if I close that file. I have to manually kill the extension process and it comes up back normal. If you can let me know what else to check for diagnostics, I can do that and provide more info. |
@kanatti Could you attach a project example? |
Sorry. I don't have any other examples than the actual project, which is private code. I also noticed that if I disable lombok there is no issue ( |
This was helpful, and fixed it for me. I wanted to add, though, that when I re-enabled lombok support, the problem didn't come back. So, even though I cleaned many times, it seems maybe something wasn't getting cleaned up. |
There were some recent improvements to project import ( #3637 ) so it could have been that if it was very recent. |
Just to be clear, this has been happening for months. If you can provide some guidance on what other debug information we can collect, I can provide that next time it happens. |
Would someone be able to check if the issue still occurs with the latest pre-release of vscode-java ( What's interesting, is this issue was originally reported in October 2022, and null analysis was first introduced at the end of September 2022. |
I hope that this fix helps someone: I work with a large java project in VS Code and my CPU usage problems were because "java autobuild" was on so every time I made the slightest change it wanted to rebuild the entire project automatically. To correct this issue, I went to File-Preferences-Settings and then searched for the setting called java autobuild and unchecked it. Then I closed VS Code and used Task Manager to force quit whatever the task was that was using 99% of my CPU (JDK something). A reboot would also work I suppose. After that, no more autobuilding and no more problems. Hope someone finds this useful. |
Try this project: https://github.com/apache/nifi.git Attach this to your .devcontainer. You need the
|
Could you reproduce the issue out of Dev Container?
Did you wait for the project to be built? |
I left it running for the whole day. It never finished. Even after I run |
[provide a description of the issue]
Environment
Steps To Reproduce
There's really nothing else to say. The extension updated and caused massive CPU spikes when vscode is running. Disabling the extension fixed the problem.
The text was updated successfully, but these errors were encountered: