-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Gulp 4.0 - gulp.watch high CPU usage after some time #2245
Comments
Windows uses polling, that's always going to be the case for every watcher. |
Why? Windows has an API for watching files, why not use it? |
What about the sudden jump in CPU usage over time? That looks like a bug to me. |
We use this library for file watching https://github.com/paulmillr/chokidar - if you think there is a bug with it you can open a ticket there (or check if one has already been opened). |
OK, thanks. |
This is also true on macOS (as noted by sryze), and the issue is not imagined.. I left a gulp-watch process running for a couple of days, noticed that my fans were spinning when the computer should have been idle, and saw that gulp was consuming > 300% CPU. After killing and restarting gulp and a cautionary reboot, after only a couple hours, CPU usage by gulp has climbed to 90%. I looked at the issues on the chokidar github page, but don't see anything related to CPU overutilization. Is this most definitely an issue with that library and it needs to be reported there? This is definitely a problem. I don't know if this was an issue before I "upgraded" to Catalina. I've been using gulp-watch for quite a long time and have never had any issues that caused me to feel compelled to check its CPU usage, and I've left gulp-watch running for weeks at a time. If this isn't a reasonably new issue, the symptoms certainly weren't apparent until recently. The issue is over a year old, and clearly has no resolution. |
@appideasDOTcom If you have issues with the file watcher you can file them here: https://github.com/paulmillr/chokidar. Make sure you are on the latest of all sub-dependencies first, chokidar has published some CPU fixes as of October. I'm going to lock this thread since this is not the right spot for these reports. |
What were you expecting to happen?
I expect gulp.watch to not use a lot of CPU while watching files.
What actually happened?
CPU usage is normal (low) after starting a watch task, but after some time passes it becomes very high, I don't know why. I have to kill the node.js process and start gulp again.
I only noticed this on Windows. I haven't had such issue yet on Linux.
Please post a sample of your gulpfile (preferably reduced to just the bit that's not working)
What version of gulp are you using?
4.0.0
What versions of npm and node are you using?
npm 6.4.0
node 8.11.1
The text was updated successfully, but these errors were encountered: