venvPath starting with tilde causes 100% CPU usage on Apple Silicon
See original GitHub issueEnvironment data
- VS Code version: 1.54.3 (Universal)
- Extension version (available under the Extensions sidebar): v2021.3.680753044
- OS and version: macOS 11.2.3 (Apple Silicon) - Darwin arm64 20.3.0
- Python version (& distribution if applicable, e.g. Anaconda): 3.9.2 (homebrew)
- Type of virtual environment used (N/A | venv | virtualenv | conda | …): venv
- Relevant/affected Python packages and their versions:
- Relevant/affected Python-related VS Code extensions and their versions:
- Value of the
python.languageServer
setting: Pylance (but disabling didn’t matter)
Expected behaviour
Editing Python files without using 100% CPU.
Actual behaviour
When python.venvPath
is set to a string starting with “~” (~/Documents/Environments
in my case), opening any Python file causes a “Code Helper (Renderer)” process to use 100% CPU, and persists after closing the file (until the whole window is closed). The interpreter selector also does not show all the environments in that directory as it normally would. Interestingly, this only seems to happen on my Apple Silicon mac, not my Intel mac.
Steps to reproduce:
- Make sure you’re on an Apple Silicon mac
mkdir -p ~/Documents/Environments
python3 -m venv ~/Documents/Environments/myenv
- Set
python.venvPath
to~/Documents/Environments
- Open a python file and check Activity Monitor or top; check for
myenv
in interpreter selector - Replace
~
with/Users/whatever
and restart VSCode - Open a python file and see normal CPU usage
Issue Analytics
- State:
- Created 2 years ago
- Comments:13 (4 by maintainers)
Top Results From Across the Web
venvPath starting with tilde causes 100% CPU usage ... - GitHub
venvPath starting with tilde causes 100 % CPU usage on Apple Silicon # ... Interestingly, this only seems to happen on my Apple...
Read more >High CPU usage on M1 - Apple Support Communities
High CPU usage on M1 ... Start up a Mac with Apple silicon in safe mode. On your Mac, choose Apple menu >...
Read more >sudden high cpu usage with google chrome - Apple Community
Web pages, whether using Chrome, Safari or another browser often go rogue and start consuming too much resources for no apparent reason. You ......
Read more >Kernel task hogging CPU - Apple Community
The Kernel task's CPU usage is fluctuating between around 3% to as high at 6,000% at times, but mostly hovering between 100-800%.
Read more >With upgrade to Monterey 12.3 - process "… - Apple Community
Then, try restarting the Mac as normal, and see if it still has a high CPU usage.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@scotchneat Orphaned processes issue should be addressed in the insiders version of the extension. Python extension activation in non python projects is due to this https://github.com/microsoft/vscode-jupyter/issues/5193
We think we know the cause of the
~
issue. We marked this as P1 and should get addressed in the april release.FWIW, opting out of
pythonDiscoveryModule
and leavingpython.venvPath
prefixed with~
also fixed the problem.