How to Increase CPU and RAM Available to VS Code
In this article
VS Code does not have a single setting that allocates more CPU or RAM to it. Instead, you increase what it can use by reducing the number of processes it spawns, disabling heavy extensions and features, and—on Windows—making sure the system itself is not starving the editor. The steps below cover the practical, supported ways to free up resources for VS Code without resorting to unsupported tweaks. Menu labels can differ slightly by version, device or region.
What You'll Need
- A working installation of VS Code (desktop version—the web version has different limits).
- Access to VS Code settings (File > Preferences > Settings on Windows/Linux, Code > Settings on macOS).
- Administrator rights if you plan to adjust Windows performance settings.
- A note of which extensions you actually use, so you can disable the rest.
Step-by-Step
- Close unused windows and workspaces. Each VS Code window runs its own renderer and extension host. Close every window you are not actively using; this alone can free hundreds of megabytes.
- Disable extensions you do not need for the current project. Open the Extensions view (Ctrl+Shift+X on Windows/Linux, Cmd+Shift+X on macOS). For each extension, use the gear icon and choose Disable (Workspace) if you only need it sometimes, or Disable globally. Extensions run in a separate process and are the most common cause of high CPU and memory use.
- Turn off unused built-in features. In Settings, search for and disable features you do not use, such as telemetry (search “telemetry”), automatic extension updates, and Git auto-fetch. Each reduces background work.
- Limit file watching and search scope. Large folders make VS Code work harder. Add exclusions to
files.watcherExcludeandsearch.excludein Settings (search for those names) for folders likenode_modules, build output, and logs. This cuts CPU spent watching and indexing files. - Reduce the number of open editors and tabs. Set
workbench.editor.limit.enabledto true and choose a small limit (for example 5). Fewer open editors means less memory used by the renderer. - Disable unnecessary language features for large files. For very large files, VS Code may slow down. Use the setting
files.maxMemoryForLargeFilesMB(search for it in Settings) to raise the memory ceiling for opening large files, but only if you have RAM to spare. - On Windows, check that the system is not limiting VS Code. Open Task Manager (Ctrl+Shift+Esc), go to the Details tab, right-click
Code.exe, choose Set priority > Above normal. This gives VS Code more CPU time when other apps compete. Do not set Realtime—it can make the system unstable. - On Windows, adjust virtual memory if the system is low on RAM. Open Settings > System > About > Advanced system settings > Performance Settings > Advanced > Virtual memory > Change. Ensure “Automatically manage paging file size for all drives” is selected, or set a custom size. This does not add physical RAM but prevents out-of-memory crashes.
- Restart VS Code after changes. Many settings and extension changes take effect only after a reload. Use the Command Palette (Ctrl+Shift+P or Cmd+Shift+P) and run “Developer: Reload Window”.
- Monitor usage to confirm the effect. Open the Command Palette and run “Developer: Open Process Explorer” to see which VS Code processes use the most CPU and memory. Use this to identify a misbehaving extension.
Common Mistakes
- Expecting a hidden “allocate more RAM” setting. VS Code uses what the operating system gives it; there is no built-in memory cap to raise.
- Disabling extensions globally when a workspace-level disable would do. You may need that extension in another project.
- Setting process priority to Realtime on Windows. This can freeze the system; Above normal is safer.
- Adding exclusions for folders you actually edit, which breaks search and IntelliSense in those folders.
- Ignoring the Extension Host process. A single poorly behaved extension can consume more CPU than the editor itself.
Tips
- Use profiles (File > Preferences > Profiles) to keep a lean set of extensions for heavy projects and a fuller set for lighter ones.
- Run “Developer: Show Running Extensions” from the Command Palette to see activation times and spot slow starters.
- Keep VS Code updated; performance fixes arrive in regular releases.
- On laptops, plug in the power adapter—some systems throttle CPU on battery.
- If you regularly hit memory limits, adding physical RAM helps more than any setting.
Troubleshooting
If VS Code still feels slow after these steps, work through the following in order.
- Restart VS Code and the computer. A full restart clears leaked memory from long-running sessions.
- Start with extensions disabled. Run the Command Palette command “Developer: Reload Window with Extensions Disabled” (or launch with
--disable-extensionsfrom a terminal). If performance improves, re-enable extensions one at a time to find the culprit. - Check the Extension Host process. In the Process Explorer, if the extension host is using high CPU, disable recently added extensions first.
- Look for file watcher errors. On large projects, the file watcher can hit system limits. Add exclusions as in step 4, and on Linux check the system’s inotify limits if you see warnings.
- Reinstall VS Code only as a last resort. Uninstalling removes settings and extensions; back up your settings and keybindings first (Settings > open the settings JSON and copy it).
Frequently Asked Questions
Can I give VS Code more RAM with a setting?
No. VS Code has no memory allocation setting. It uses available system memory, and you influence that by closing windows, disabling extensions, and reducing open files.
Why does VS Code use so much CPU when idle?
Usually an extension, file watching on a large folder, or search indexing. Use the Process Explorer and “Show Running Extensions” to identify the cause.
Does increasing process priority help?
It can help when other apps compete for CPU, but it does not increase the total CPU or RAM available. Use Above normal, not Realtime.
Is the web version of VS Code limited differently?
Yes. The browser-based version runs within the browser’s memory limits and cannot use the same desktop settings or extensions. For heavy work, use the desktop app.
Will adding more RAM to my PC speed up VS Code?
If your system is routinely near its memory limit, yes—more physical RAM reduces swapping and out-of-memory crashes. If RAM is already sufficient, the bottleneck is more likely CPU or disk.
Can I limit how much memory VS Code uses?
There is no direct cap. You can reduce usage indirectly by limiting open editors, disabling extensions, and excluding folders from watching and search.