VS Code High CPU Usage Problem Solved
High CPU usage in Visual Studio Code can slow down your entire system, making it difficult to work efficiently.
This issue often arises due to resource-intensive extensions, large files, or background processes.
Here’s how to tackle it: Start by identifying the root cause using the Process Explorer in VS Code.
Go to Help > Process Explorer
, and you’ll see a list of processes along with their CPU usage.
Look for any processes consuming an unusually high amount of resources.
Often, extensions are the culprits.
Disable extensions one by one to identify which one is causing the problem.
Once identified, consider removing or replacing it with a lighter alternative.
Another common cause is large files or folders in your workspace.
VS Code’s file indexing can be resource-intensive.
To reduce this load, exclude unnecessary files and folders from the workspace.
Open settings.json
and add rules to **files.exclude**
and **search.exclude**
.
Adjusting your settings can also help.
For example, disabling auto-save (**files.autoSave**: **off**
) and reducing the frequency of IntelliSense suggestions can significantly lower CPU usage.
Additionally, ensure your system drivers, especially GPU drivers, are up-to-date.
VS Code utilizes hardware acceleration, which can lead to high CPU usage if drivers are outdated.
If hardware acceleration itself is causing issues, disable it by adding **disable-hardware-acceleration**: true
to your settings.
Background tasks like Git operations can also consume resources.
If you’re working in a Git-enabled project, ensure there are no uncommitted changes or heavy operations running in the background.
Lastly, consider reinstalling VS Code.
A clean installation can often resolve performance issues.
Before reinstalling, backup your settings and extensions.
These steps should help you minimize CPU usage and improve performance in Visual Studio Code.