vscode-R icon indicating copy to clipboard operation
vscode-R copied to clipboard

Sporadic 104% CPU utilization by Code Helper

Open Shoeboxam opened this issue 1 year ago • 1 comments

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

Shoeboxam avatar Aug 15 '23 05:08 Shoeboxam