Share via

Limit CPU usage in Visual Studio code

Kim_2022 1 Reputation point
2022-06-14T12:28:15.947+00:00

Hi,

I would like to ask if it's possible to limit the CPU usage of Visual Studio Code?

I saw some articles related to disabling extensions and typescripts and it works as it does not clog the CPU but on the system side or in the Vscode itself, would it be possible to force limit the resources that code can consume?

I am using Visual Studio Code 1.67.2 in remote (Windows 10 Enterprise using ssh) and in a shared virtual machine - Centos 7 which affects other users when my Vscode clogs the CPU.

Thank you in advance for answering my question!

Developer technologies | Visual Studio | Debugging
Developer technologies | Visual Studio | Setup
Developer technologies | Visual Studio | Other
Developer technologies | Visual Studio | Other

A family of Microsoft suites of integrated development tools for building applications for Windows, the web, mobile devices and many other platforms. Miscellaneous topics that do not fit into specific categories.

0 comments No comments

2 answers

Sort by: Most helpful
  1. Kim_2022 1 Reputation point
    2022-06-15T12:30:43.357+00:00

    Thank you for your answer @Michael Taylor , however I would also like to know if there is a settings in the Vscode itself where we can adjust the # of threads that code is using aside from your suggestion to reduce the extensions? If there is any place in the vscode setup of the user that we can limit the amount of resources?

    Was this answer helpful?


  2. Michael Taylor 61,221 Reputation points
    2022-06-14T14:44:48.63+00:00

    There is no throttling of the CPU for most any application. That would be very hard to do. The most you can do is reduce the # of threads that are being used which could be done by reducing extensions. The alternative is to use Task Manager to specify the logical processors that can be used. For example if you have 8 cores then you could tell Windows to limit the process to 4. However this has to be done each time the process starts. If you wanted this as a permanent solution then you'd need to write an extension (if it is allowed).

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.