Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extension causes high cpu load #104

Open
ricardorosiles opened this issue Dec 16, 2019 · 6 comments
Open

Extension causes high cpu load #104

ricardorosiles opened this issue Dec 16, 2019 · 6 comments

Comments

@ricardorosiles
Copy link

  • Issue Type: Performance
  • Extension Name: git-project-manager
  • Extension Version: 1.7.1
  • OS Version: Windows_NT x64 10.0.18362
  • VSCode version: 1.41.0

⚠️ Make sure to attach this file from your home-directory:
⚠️C:\Users\DELL\felipecaputo.git-project-manager-unresponsive.cpuprofile.txt

Find more details here: https://github.com/microsoft/vscode/wiki/Explain-extension-causes-high-cpu-load

@felipecaputo
Copy link
Owner

Hi, I'll try to take a look a this and let you know

@eriktrom
Copy link

This happened to me, but It seems upstream related.

(b/c of that) IMHO no one should de-rank this plugin with low stars due to this issue


system:

macOS 10.5.15

vscode:

Version: 1.45.1
Commit: 5763d909d5f12fe19f215cbfdd29a91c0fa9208a
Date: 2020-05-14T08:33:47.663Z
Electron: 7.2.4
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Darwin x64 19.5.0

GPM:

1.7.1

Cpu Profile:

Upon request, will share private gist url, via private email


TMI

(you be the judge, I'll dump everything i got, literally all can think of, poorly written)

I noticed after getting the message and the cpuprofile link, that upon using GPM: Refresh Projects, I saw ..../.Trash/<...rest> flash within the status bar. The .Trash folder may have been related to using the Run Code vscode plugin with C++ files and the last bit is that it popped exactly when I used "peek references" for the first time today on a variable that was defined (in essence) as the "a pointer to the the value NULL" - aka, a pointer from a leaf node w/ no children - this then made vscode-clang-0.2.3 work (with a notification box, that took some time to finish) and out of sheer luck(or not) GPM began running on its own at some point while the clang extension was running - finally, there was this "new looking" icon in my status bar that looked like a cylinder, i clicked it, that brought up a notification that GPM had prevented one or more extensions from loading, with the cpuprofile alert box following that. The extension host logs, upon inspection showed ~100% cpu usage, 4 log lines, spaced ~1 second apart, like so

[2020-05-28 19:48:46.079] [renderer2] [warning] UNRESPONSIVE extension host, 'felipecaputo.git-project-manager' took 98% of 1998.449ms, saved PROFILE here: '/var/folders/85/m6931n7s26l_48j9g9lrn7zh0000gn/T/exthost-5da0e9.cpuprofile' [{"id":"EditorConfig.EditorConfig","total":1011,"percentage":0},{"id":"felipecaputo.git-project-manager","total":1954766,"percentage":98},{"id":"gc","total":28572,"percentage":1},{"id":"ms-vscode.cpptools","total":876,"percentage":0},{"id":"program","total":10077,"percentage":1},{"id":"self","total":2974,"percentage":0}]
[2020-05-28 19:49:19.529] [renderer2] [warning] UNRESPONSIVE extension host, 'felipecaputo.git-project-manager' took 97% of 10896.369ms, saved PROFILE here: '/var/folders/85/m6931n7s26l_48j9g9lrn7zh0000gn/T/exthost-749f5f.cpuprofile' [{"id":"EditorConfig.EditorConfig","total":520,"percentage":0},{"id":"felipecaputo.git-project-manager","total":10544733,"percentage":97},{"id":"gc","total":119021,"percentage":1},{"id":"googlecloudtools.cloudcode","total":635,"percentage":0},{"id":"ms-vscode.cpptools","total":404,"percentage":0},{"id":"program","total":159664,"percentage":1},{"id":"self","total":71129,"percentage":1}]
[2020-05-28 19:50:52.700] [renderer2] [warning] UNRESPONSIVE extension host, 'felipecaputo.git-project-manager' took 98% of 30833.104ms, saved PROFILE here: '/var/folders/85/m6931n7s26l_48j9g9lrn7zh0000gn/T/exthost-3dddfa.cpuprofile' [{"id":"felipecaputo.git-project-manager","total":30210934,"percentage":98},{"id":"gc","total":324500,"percentage":1},{"id":"googlecloudtools.cloudcode","total":481,"percentage":0},{"id":"ms-vscode.cpptools","total":253,"percentage":0},{"id":"program","total":135573,"percentage":0},{"id":"self","total":160442,"percentage":1},{"id":"vscode.git","total":510,"percentage":0},{"id":"vscode.vscode-account","total":129,"percentage":0}]
[2020-05-28 19:52:20.406] [renderer2] [warning] UNRESPONSIVE extension host, 'felipecaputo.git-project-manager' took 100% of 54097.354ms, saved PROFILE here: '/var/folders/85/m6931n7s26l_48j9g9lrn7zh0000gn/T/exthost-7c2237.cpuprofile' [{"id":"felipecaputo.git-project-manager","total":53936819,"percentage":100},{"id":"gc","total":111410,"percentage":0},{"id":"ms-kubernetes-tools.vscode-kubernetes-tools","total":132,"percentage":0},{"id":"program","total":41422,"percentage":0},{"id":"redhat.vscode-yaml","total":143,"percentage":0},{"id":"self","total":7183,"percentage":0},{"id":"vscode.git","total":131,"percentage":0}]

There was no clang extension host log, I presume b/c it had a notification window and long running progress bar, thus it was not an error nor even logged in extension hosts log file.

I'm providing this purely b/c what I experienced seems less like a problem with GPM itself, and more like a problem with the scheduling and/or conflict resolution of a long running extension(vscode-clang-0.2.3) that is working correctly(by notifying me with a progress bar) and this GPM extension that was also working correctly, and even better, spit out a profile - my point here being that 2 properly working extensions and a .Trash file along with the extension host logging output lead me to believe there is an upstream bug, but that this extension could on it's own ignore .Trash files and perhaps that would help, or .Trash is irrelevant and its purely an upstream issue with scheduling and/or memory locking or whatever -- or maybe there is just an issue with the auto cpu profiling that vscode does, b/c in the end, the only thing that didn't work out, is that I got a cpuprofile and GPM was unresponsive until the other plugin completed and dismissed its notification popup when progress finished, which is 'normal javascript' single threaded behavior.

thus - i wouldn't expect this is a problem caused by GPM or one that @felipecaputo would know what to consider without a lots of context. But perhaps the vscode team or someone at Microsoft may find it useful. Also a future traveler may have an experience and output to share that adds more context.

@felipecaputo
Copy link
Owner

Hi @eriktrom thank you for this well written issue. GPM looks only to folders, and this .Trash is a folder?

If it is, could you try put it in ignoredFolders config for a try.

I've made a big change migrating extension to TS last month, and fixed some issues. I'll do the last tests and release it, and maybe fix this issue

@eriktrom
Copy link

Looks like its was .Trash-1000 which I'm pretty sure is due to using Parallels Desktop for Mac, running Ubuntu-18 now and then. I'll add that to ignoredFolders for sure. I have GPM set to traverse a few directories deep, I presume **/.Trash-100 should fix the whole traversal, if not let me know

The kicker is that I'll have to get lucky again(or not) ha - in this case, if that were too work, the luck would be in never experiencing a cpuprofile dump due to whatever happened last nite, ever again. (which I still think was literally the luck of the draw, and not related solely to GPM, maybe not even partially related)

I've made a big change migrating extension to TS last month, and fixed some issues. I'll do the last tests and release it, and maybe fix this issue

Sweet, it's one of my favorite vscode plugins - it's become how I manage the chaos of having so many git projects, your awesome

@eriktrom
Copy link

@felipecaputo - thanks for the help back in 2019 - figured i'd drop u a line on a new finding that happened when I re-organized my mac (so that my dev directory was not under Documents, instead, its under my home dir). It got the extension host to freeze, which is the first time in i guess over a year now. (since I added directories to ignoredFolders, which worked like magic... but I think 'the real issue' is more likely what I see tonight:

I put this line in my vscode settings.json file, it says it all:

"gitProjectManager.storeRepositoriesBetweenSessions": true, // this caches *something*, and an alias that points to a file in a removed(cached) directory will cause a stall in vscode extension host, popping the error message box, halting this extension, recall ~/Documents/dev -> ~/dev change due to enabling icloud for Documents folder, see #104, my march 2021 comment, at felipecaputo/git-project-manager

tl;dr is - it was hanging on a file, actually, an alias to a file, where the alias was in the root of a repo and pointed to a subdirectory/originalFile of that repo, but the repo's cached absolute path had changed from~/Documents/dev -> ~/dev - which I know just happened, b/c I just enabled iCloud for Documents and Desktop. (2021, eh, better late than (n)ever, LOL)

cheerio

@felipecaputo
Copy link
Owner

hi @eriktrom thanks for the feedback.

I've been working on a complete rebuild of the extension.

Some job demands made me take some time off open source (this pandemic make people use a lot online services) but I think I removed it already, and if not, I will remove it, since using chokidar and VSCode builtin cache storage the UX will be a lot better.

Thanks for the feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants