REditorSupport / REditorSupport/vscode-R

Sporadic 104% CPU utilization by Code Helper

Open
#1,401 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug stale
Dominant language
TypeScript
Stars
1.2k
Forks
139
Avg merge
2h 46m
Merged PRs (30d)
5

Description

Describe the bug
Sporadically when I run devtools::check() via a VSCode task, VSCode becomes laggy (~1 frame every 15 seconds or less).
Files will no longer save, and the Mac Activity Monitor shows a process Code Helper at 104% CPU utilization.

This PID seems to be spawned by vscode-R, though I can't be certain:

ps aux | grep 74909
michael          74909  99.8  1.7 1595055600 292368   ??  R     4:20PM   4:30.87 /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Renderer).app/Contents/MacOS/Code Helper (Renderer) --type=renderer --user-data-dir=/Users/michael/Library/Application Support/Code --standard-schemes=vscode-webview,vscode-file --enable-sandbox --secure-schemes=vscode-webview,vscode-file --bypasscsp-schemes --cors-schemes=vscode-webview,vscode-file --fetch-schemes=vscode-webview,vscode-file --service-worker-schemes=vscode-webview --streaming-schemes --app-path=/Applications/Visual Studio Code.app/Contents/Resources/app --enable-sandbox --enable-blink-features=HighlightAPI --first-renderer-process --lang=en-US --num-raster-threads=4 --enable-zero-copy --enable-gpu-memory-buffer-compositor-resources --enable-main-frame-before-activation --renderer-client-id=4 --time-ticks-at-unix-epoch=-1691237584160409 --launch-time-ticks=806869300309 --shared-files --field-trial-handle=1718379636,r,5063751642301275775,14862766121404794949,131072 --disable-features=CalculateNativeWinOcclusion,SpareRendererForSitePerProcess --vscode-window-config=vscode:7a6c3975-a481-49cf-96fc-954ed396f7d8 --seatbelt-client=55
michael          17471   0.0  0.0 408636160   1456 s026  S+   12:27AM   0:00.00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn --exclude-dir=.idea --exclude-dir=.tox 74909

Whenever this happens, I Force Quit the process from the Mac Activity Monitor, which crashes VSCode, allowing me to start VSCode again to normal operation.

To Reproduce

I use the following build task (simply run devtools::check from another folder):

        {
            "label": "R/ check (devtools only)",
            "type": "shell",
            "group": "build",
            "command": "cd R/opendpbase/ && Rscript -e 'devtools::check()'"
        },

Same issue occurs if I run cd R/opendpbase/ && R CMD build . && R CMD check --as-cran opendpbase_*.tar.gz.

The issue happens sporadically, about once every 4-5 task runs.
The issue doesn't appear when I run the same command from a non-VSCode terminal.

Can you fix this issue by yourself? (We appreciate the help)

No.

Expected behavior
VSCode should not freeze when I run R tasks.

Environment (please complete the following information):

  • OS: macOS
  • VSCode Version: 1.81.1
  • R Version: 4.3.0
  • vscode-R version: 2.8.1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is named. Start by reproducing the VS Code task with devtools::check() and the equivalent R CMD build/check commands, comparing them with a non-VSCode terminal run; trace the vscode-R task path and identify what causes Code Helper to reach high CPU. Done means R tasks no longer freeze VSCode during repeated runs.

Written by the indexing model from the issue text.

Assessment

Tech stack
r, typescript, vscode
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.