Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vs code triggering antimalware service executable to use high cpu

I noticed since yesterday my system using close to 100% CPU and memory. I found whenever I am using VS Code the Antimalware Service Executable uses above 60% of CPU usage all the time.

I turned off real-time protection and then problem with VS code using closely 100% of memory. Tried hard and shutdown the system, this issue keep coming whenever I opened VS Code.

I just updated my VS Code yesterday. What should I do?

like image 910
Mahesh Avatar asked Aug 30 '26 23:08

Mahesh


2 Answers

You can tell Windows anti-malware to trust VS Code in its settings. If the problem is really due to an extension that runs separate programs in separate processes, you'd also need to tell it to trust those programs. See the Windows docs for how to do this.

Ex. for windows 11:

  1. Select Start, then open Settings. Under Privacy & security, select Virus & threat protection.

  2. Under Virus & threat protection settings, select Manage settings, and then under Exclusions, select Add or remove exclusions.

  3. Select Add an exclusion, and then select from files, folders, file types, or process. A folder exclusion will apply to all subfolders within the folder as well.

If VS Code uses 100% CPU with no antivirus enabled at all though, something is really wrong and maybe you should at least try uninstalling and reinstalling it.

like image 88
starball Avatar answered Sep 02 '26 14:09

starball


As a c# developer, using Visual Studio, I found that adding the following exclusions to improve build times...

Add [Folder] project(s) path

Add [Process] aspnet_compiler.exe

Add [Process] csc.exe

Add [Process] VBCSCompiler.exe

As a sidenote: I try to run a pretty secure environment, so I am personally not worried about these rules causing security issues, but one should take into account the security consequences of excluding these items.

like image 22
lemonskunnk Avatar answered Sep 02 '26 12:09

lemonskunnk



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!