Skip to content

High CPU usage in develop environment. #10716

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

Closed
lyon-liao opened this issue May 8, 2018 · 16 comments
Closed

High CPU usage in develop environment. #10716

lyon-liao opened this issue May 8, 2018 · 16 comments
Labels
needs: investigation Requires some digging to determine if action is needed

Comments

@lyon-liao
Copy link

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

@lyon-liao lyon-liao changed the title High CPU usage in development environment. High CPU usage in develop environment. May 8, 2018
@phl3x0r
Copy link

phl3x0r commented May 8, 2018

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.

@clydin clydin added comp: cli/serve needs: investigation Requires some digging to determine if action is needed labels May 8, 2018
@lyon-liao
Copy link
Author

@phl3x0r I closed all the IDE, And started project in terminal, The CPU usage is still high.

@lyon-liao
Copy link
Author

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

@mmmichl
Copy link

mmmichl commented May 9, 2018

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.

@smlombardi
Copy link

I noticed today after updating to Angular 6 my fans are going nuts on my 2017 MBP, 10.13.4, so I checked and NG averages 166%, maxing at 268% CPU.

screen shot 2018-05-09 at 3 52 28 pm

@lyon-liao
Copy link
Author

@smlombardi My MBP version is MacBook Pro (13-inch, 2017, Two Thunderbolt 3 ports), When I upgrade angular-cli to 6.0.0. The CPU high usage goes away.

@lyon-liao
Copy link
Author

lyon-liao commented May 10, 2018

@mmmichl Wonderingly, I upgrade the angular-cli t0 6.0.0. that issue is gone, But I want to find the result, I backed to the last version, I Removed all the node_modules, and install again. The CPU usage isn't high again, Miraculous! Without install the fsevents.
In addition, I don't want to upgrade angular-cli to 6.0.0, As a break change blocked my work. #10430

@smlombardi
Copy link

@LiaoSong Not for me, 6.0.0 still spikes my CPU — fans going nuts the whole time server is running

@lyon-liao
Copy link
Author

@smlombardi Remove your node_modules and reinstall it. I change the version to 1.7.4, It works well.

@smlombardi
Copy link

@LiaoSong That helped. Stuck with 6.0.0. Thanks. 👍🏻

@tucq88
Copy link

tucq88 commented Oct 3, 2018

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!

@mmmichl
Copy link

mmmichl commented Oct 4, 2018

@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.

@DuncanFaulkner
Copy link

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.

@xiaohuilam
Copy link

image

angular makes me anger

@radovansurlak
Copy link

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 :D

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs: investigation Requires some digging to determine if action is needed
Projects
None yet
Development

No branches or pull requests

9 participants