jrieken / fuzzy-definitions

MIT License
6 stars 3 forks source link

100% CPU #2

Open cmalard opened 7 years ago

cmalard commented 7 years ago

Hello there,

Something got wrong ^^ screen

VSCode is closed but this extension is still running and making my fans crazy. Didn't know how to provide you more infos... so I simply killed the process.

By the way, nice work ! It does the job, thanks :-)

cmalard commented 5 years ago

Still experiencing this bug, 1 time each 1~2 day :-|

PowerWeb5 commented 5 years ago

I'm also seeing this several times per day, with this extension spawning node.exe processes which never exit, even days later, and keep spawning more of them, each of which takes up 100% of a CPU core.

I sometimes see up to 8 node.exe processes leftover using 100% of a CPU core each even several days later after having closed VSCode.

This is for node.exe processes with command line args like the following:

node C:\Users\Dan.vscode\extensions\jrieken.fuzzy-definitions-0.0.3\node_modules\nak\bin\nak --ackmate -G ".js" -d "node_modules" "(let|const|var|function|class)\s+if|if\s:" c:\Users\Dan\Backups\Firefox\Dev\checkerplusforgmail@jasonsavard.com

node C:\Users\Dan.vscode\extensions\jrieken.fuzzy-definitions-0.0.3\node_modules\nak\bin\nak --ackmate -G ".js" -d "node_modules" "(let|const|var|function|class)\s+var|var\s:" c:\Users\Dan\Backups\Firefox\Dev\checkerplusforgmail@jasonsavard.com

It seems to happen most often if use Go To Definition for something common like "if" or "var" (though occurs in other cases too) which is really easy to do unintentionally when trying to Ctrl+Click on keywords. But even then

One of the last commits, f65c5765122516796df6b57facc2334694f44ebf, says it was supposed to "kill nak after 2secs" (where nak is the NPM module used for searching through files) but node.exe remains running longer than 2 seconds all the time, so doesn't seem to actually be working.

For reference, my config:

You can see a few of the left-over processes still running after half an hour (as I'd just closed the ones that were running for days) each spawned for a single Ctrl-Click search in the screenshot below: image

@jrieken Can you please fix this and publish it for VSCode so can get this critical issue fixed?

Thanks for developing this. Fuzzy Definitions is an indispensable VSCode extension. Without it, VSCode usually can't find definitions even when have exact math for some reason for JavaScript & TypeScript (anyone found a way around that btw?). However, I can't use it or have to suffer slowing down PC all the time and constantly checking processes, without this getting fixed. And for all the thousands of users out there, they probably aren't even aware how it is slowing down their PC.

@ Any other JS developer?

If can't get a response from developer (as hasn't been to this 1+ year old issue and no commits since 2016), can someone, in worst case, fork this, fix and releasing as a new fixed extension for VSCode?

jrieken commented 5 years ago

@PowerAccess How about you doing a PR this?

PowerWeb5 commented 5 years ago

I implemented a fix for this for this as PR. Please test and approve my PR #3 "Fix for Critical Issue #2: Spawning 100% CPU Processes that Never Exit"

Needs further testing first to ensure doesn't break spawning the node.exe for nak file search process and that always exits even if Ctrl-Click / Go to Definition for If or Var keywords in large projects with many node modules, for example.

Fixes & Enhancements

Notes

To-Do Suggestions

veich commented 4 years ago

so what's the status with this? I have to kill this node process 20 times a day :(