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
Very high CPU usage with new watcher #701
Comments
It doesn't seem to lag so much if I explicitly install |
@gaearon Is it lower for small projects? Maybe the watcher count is linear to CPU usage... @gaearon Could you verify if
Chokidar call: https://github.com/webpack/watchpack/blob/master/lib/DirectoryWatcher.js#L21-L27 |
It's strange. I'm not sure what the difference is yet. I'll keep investigating.. |
OK, let's presume I did something stupid. Still—I wonder if Watchpack (and Webpack) should now have |
chokidar has it as optional dep: https://github.com/paulmillr/chokidar/blob/master/package.json#L46 So theoretically it should be installed if possible when installing chokidar... |
yeah everything is cool this way |
In case this helps someone else, I was able to fix high CPU usage by doing what gaearon suggested in a previous comment. OS X 10.11.3 (on both laptops). |
I just ran into this too. You don't need to run |
Facing the same issue but on Windows 10, and I can't install fsevents, it's an OS X-only module... |
For the record, nuking |
What should I do on Windows 8.1 to solve the issue?
All the time webpack-dev-server is running it's process consumes about ~30% of CPU. |
@CoderLex Have you tried this? webpack/watchpack#23 |
@gaearon I'm sorry for dusturbing. I've just found out the cause of my problem and it doesn't relate to this topic. The reason it consumed so much CPU was in these lines: watchOptions: {
aggregateTimeout: 300, // <---------
poll: 1000, // <---------
ignored: /node_modules/
}, I haven't even seen what they do in docs as the most of the config came from |
My brain is lazy so chances are good I totally forget about in a couple of weeks. 😭 |
The only case |
@winterbe I feel the same way about keeping dependencies obvious. Why not make a note in your package.json? Because JSON doesn't support comments some folks have come up with alternative approaches. |
In my experience, this CPU hogging happens every time I upgrade node.js to a new version, I need to reinstall |
@ngyikp in that case, you just need |
Thanks @gaearon for this fix, saved my day 👍 |
If you use yarn you can do
|
I should keep a note for |
Deleting the entire node_modules folder and |
This should solve webpack using up 100% CPU on OSX. See webpack/webpack#701 Note fsevents is an OSX only package, but having it as an "optional" dependency means yarn will ignore build errors for the package.
Solved by simply running |
Is this still relevant? If so, should we add a canonical solution to the docs?
and it does seem to help, but I'd love to know if these commands are actually doing anything useful or it's just magical thinking :-) |
150% in watch mode using webpack 4.17.2. The fsevents fix did not work for me, but this did: |
Webpack has an issue where on a mac, the CPU usage spikes to more than a 100% Reference: - storybookjs/storybook#752 - webpack/webpack#701 Adding fsevents as a dependency fixes this issue, putting as optional means it doesn't break non-mac installations
* Adds fsevents to optional dependencies Webpack has an issue where on a mac, the CPU usage spikes to more than a 100% Reference: - storybookjs/storybook#752 - webpack/webpack#701 Adding fsevents as a dependency fixes this issue, putting as optional means it doesn't break non-mac installations * Updates Page Component - Updates styles to match latest designs - Improves html semantics and accessibility: a. Page header using <header> b. Headings Using <h1> and <h2> c. Cards use <section> - Moves to TypeScript - Fixes import in Accordion * Adds Page.Heading Pages generally have a main heading and multiple secondary ones, this component adds the ability to use <Page.Heading> with the correct styles for pages * Adds Page.Heading docs * Adds tests * Update namespaces for Enzyme 3 Change the way to import React Prettier Run prettier on precommit
Strange, this just started happening to me, running around 270% CPU. Hadn't happened before, not sure what changed. @tkluysk's |
|
Now that 1.5 switched to new watcher by default, I noticed it's using a lot of CPU all the time:
It's not a Gulp issue because it goes away if I use
OldWatchingPlugin
.It's also not related to compilation because it happens when Webpack is idle as well.
Any ideas?
OS X 10.10.1
The text was updated successfully, but these errors were encountered: