windowsvisual-studio-codeantimalware

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?


Solution

  • 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.