angular-cli: High CPU usage in develop environment.

Hi guys, I started up a new project with below version. The high CPU usage is showing, Even in idle time.

Versions

Angular CLI: 1.7.4
Node: 8.11.1
OS: darwin x64
Angular: 6.0.0

Observed behavior

image

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 16

Most upvoted comments

I’m still seeing high CPU usage this was present on version 5, 6 and now in version 7, I’m running on ubuntu so fsevents isn’t an option. It seems to spike every so often runs high for 5 - 10 minutes then returns to normal, during the course of a day this will happen several times, this makes building the project a bit slow, it’s live-able with but would like to see it fixed at some point, something must be causing the issue.

@tucq88 I cannot give you details on the reasons, maybe the package description will help you https://www.npmjs.com/package/fsevents

Just be cautious to not add it to package.json! Ohterwise the installation will fail on Linux or Windows.

Do you run mac? Check if you have fsevents install, if not add it: npm i --no-save fsevents and see if the high cpu usage goes away.

I don’t think this is related to angular CLI. Have you tried figuring out what is causing the CPU usage? If you use VSCode (which many do), it may very well be caused by an extension. You can test this out by disabling all your extensions and see if it gets better, then enable them one at a time to find the culprit.

Hey guys, I started using https://github.com/fuyu/AppPolice to limit the CPU load of ng serve. The load was making my Mac really slow, this one allows you to limit the CPU usage.

It doesn’t solve the cause, but at least I can work now 😄

image

angular makes me anger

Do you run mac? Check if you have fsevents install, if not add it: npm i --no-save fsevents and see if the high cpu usage goes away.

You saved me @mmmichl . I have been struggled with this high CPU problem for nearly a year, since Angular 4 to now 6, and I blame that my macbook pro full options mid 2015 was out-of-date, can’t be used for web development anymore. Could you please explain why and how fsevents was that magical ? Or just ref links is enough. Thanks and wish you a nice day!

I found the ng process is NO.1 of the hard disk usage.