-
Notifications
You must be signed in to change notification settings - Fork 12k
Memory usage of node process for ng test/serve is very high #5613
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
Comments
This has been the case for a while, so in that sense it is intended (e.g. not a bug). I do agree it's quite a bit and there's probably room for improvement there. |
With a reasonably large project I get OOM when the process hits Node's memory limit. Since you can't set Node's memory limit via env var, I have to dig around manually to run the tests.
|
@timruffles Yes, the memory usage of npm install is also crazy. But this is another topic. Is the problem that developers don't understand that JSON-objects in memory need memory and isn't just a virtual, magic document from outer space ;-) |
Running two concurrent |
Agree. |
This issue is rather old but I've never had a problem on my local setup until recently updating to CLI v1.3.0 It's running on macOS Sierra 10.12.6 and I have to restart The apps size is about 150 components, no big dependencies other than angular material. |
Since there isnt a suitable recent ticket I can +1, im adding that we're having major issues with Jenkins and angular builds taking up way too much memory and causing the no response in 20000ms issue. From looking at the resources, excessive RAM usage from angular cli and npm seems to be the cause during builds |
No solution for angular but I'm using now npm 5.4.2 and this version and some before (5.x.y) are much faster and use less memory. |
I also have gotten to where I'm constantly restarting my |
Any update? Same issue using 'ng serve --hmr' |
Same issue. system freezes. |
+1 |
This softens the situation: node --max_old_space_size=512 "./node_modules/@angular/cli/bin/ng" serve |
Same here, working with latest version of all.. With about 15 components and 3 services getting 3 gb of ram consumption an browser is freezing.. |
+1, Same issue with me, every day need close and open Angular, my project based on Nebular ngx-Admin, about 30~40 components, any update on this issue? Package Version@angular-devkit/architect 0.8.3 |
Memory running out was happening to me because I had a serializer file with a function returning an object with several entries.
Also, some features in VS Code stopped working just by opening this file. After examining its Process Explorer, VS Code's I fixed just using |
+1 |
I have a similar issue. I cant run typescript compilation after deploy on an EC2 instance with 1gb of ram (900+mb free), even with all optimizations turned off. It runs out of memory and crashes almost instantly. "optimization": false,
"outputHashing": "all",
"sourceMap": false,
"extractCss": false,
"namedChunks": false,
"aot": false,
"extractLicenses": false,
"vendorChunk": false,
"buildOptimizer": false |
same issue here, When running ng serve, I have two processes which will eat up 1.3 and 1.4GB, which makes 2.7GB for both ! this is ridiculously too large, it freezes my system eventually, since I also have a backend, a browser and an IDE to run. system is ubuntu 18, |
@RodolpheGohard have you tried lowering |
Generating new App with ng new TestApp consuming around 300 mb when served with no changes |
I can't believe this is still an issue after 2 years. My PC literally freezes when running 'ng serve'. |
2019 anyone? I have windows 10 and the moment I run ng serve --open to run Angular app, the VS Code suddenly works slow, Visual Studio 2017 also becomes slow and the node.exe CPU usage is super high. |
With Angular 9 right around the corner, let's see if this problem gets worse or better. |
A little bit better on my mac but using --max_old_space_size=1024 |
my app angular 8.3(few components) is run on ubuntu 16.4 with 2g memory and im facing the same issue. its being killed, and that's killing me... |
I try to use Angular together with Glitch.com (something like stackblitz) but I cant use it with ng serve because it regulary exceeds the memory limit of 512 mb so its not usable. Any idea what I can do? I want to use glitch.com to work on private projects from everywhere... The app exceeded the memory limit. Stopping and pausing for 15 seconds. I use latest Angular (9) |
This is really depressing, I am struggling from 2 days to deploy my app on aws t2 micro. I have memory swap of 4GB and still it;s giving the same error. |
With Angular 9 the memory usage decreased significantly during |
Update: My Node.js is now using 1..5 GB of RAM when debugging Angular 9.0.0 😮 |
Since Angular 9, our project reached an all time high of 2.3 GB for I can remember Angular's processes using way less RAM a year ago. I'm unsure what exactly caused this to progressiveley increase. |
Tried using only VS Code instead of WebStorm and Visual Studio? |
Is starting to get problematic in our company: Computers with not more than 8 GB RAM start to freeze. We're using Angular CLI 8.3.22. I hope Angular 9 makes it better. According to @blogcraft it gets a little better, according to @wartab it's getting worse. Is there more people having experience with 9? |
For me it is getting better (not good).Release build time earlyer was over 3 minutes with 3.5 memory of ram usage. Now under 2 minutes and 2gb with angular 9. |
Could a team member or a top colaborator from the Angular project give us some detailed information about why that happens? That RAM usage is horrible for some software houses. |
macbook pro 2015 core i7, 16gb ram, fans going crazy with ng build, ng test, ng server etc. also most ci platforms have 4gb ram limit, so our tests and builds are failing on pipeline |
I use Azure DevOps for CI, maybe give it a shot? |
the CPU usage is insane as well. I've got ng serve running locally in the background and haven't touched the frontend for at least an hour, just left it idle. It's using 90% CPU and I'm not even using it. This is on a MBP 15" Late 2019 |
High CPU usage (constant 90% on ng serve) on a MacBook Pro can be solved by installing newest version of fsevents |
Hi all, This thread has been open for 3 years now and was originally reporting using Angular CLI Since then, a lot of things changed in the entire eco-system, while memory usage might still be high when using Having all the feedback in a single thread makes it hard to get meaningful reports, or to inform people of what versions the regressions that affect them were fixed. High memory usage can have a number of root causes ranging from a Node.js (EX version 11 is known to have memory related bugs), compiler, application architecture, NGCC or Angular CLI. Unfortunately without a reproduction (Even shared privately) it would be almost impossible to find and solve the root cause. Thus, my recommendation would be to open new issue and provide all the information requested in the issue template, that way we will be able to action the issue. Thank you all for your understanding. |
Imagine closing the issue being the only response to this increasingly worsening problem. |
@wartab, on my machine a new Angular projects takes 366Mb for the main process + 169Mb for the forked checker during Unfortunately, there is no silver bullet that solves all memory issues, and every problem here might very well have a different root cause. Yet there isn't enough information in a given comment to help use understand how we can reproduce the issue. So please help us to help you, by filling a new issue providing all the information required or even better a reproduction. We definitely want to get to the bottom of this, but we cannot investigate and eventually fix something which we cannot reproduce. |
@alan-agius4 in your perspective, is it normal a new project consuming almost 500 Mb of RAM? I think you've just reproduced the issue. |
@arielmoraes, there isn't much Angular CLI can do abut this. I would say that 500MB is resonable given the complexity of the Angular CLI. Also, you can see that the TypeScript compiler can consume a GB on medium-sized projects, just search for high memory usage in the TypeScript issue queue. If you are still not convinced, you can build the demo file from Building your first TypeScript file handbook, it consumes 152MB. So, I would say that 500MB for Angular CLI is very good. If you want to convince your self, here's a repo:
That repo only provides this file: function greeter(person) {
return "Hello, " + person;
}
let user = "Jane User";
document.body.textContent = greeter(user); If you run
And you will see that the command has consumed |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug Report or Feature Request (mark with an
x
)Versions.
ng --version
_ _ ____ _ ___
/ \ _ __ __ _ _ | | __ _ _ __ / | | | |
/ △ \ | ' \ / _
| | | | |/ _
| '| | | | | | |/ ___ | | | | (| | || | | (| | | | || | | |
// __| ||_, |_,||_,|| _|||
|___/
@angular/cli: 1.0.0-rc.2
node: 6.10.1
os: win32 x64 (Win10)
@angular/common: 2.4.10
@angular/compiler: 2.4.10
@angular/core: 2.4.10
@angular/forms: 2.4.10
@angular/http: 2.4.10
@angular/material: 2.0.0-beta.2
@angular/platform-browser: 2.4.10
@angular/platform-browser-dynamic: 2.4.10
@angular/router: 3.4.10
@angular/cli: 1.0.0-rc.2
@angular/compiler-cli: 2.4.10
Repro steps.
Run npm test or npm start which runs ng test / ng serve
The log given by the failure.
Memory usage for each node process is between 600MB and 1000MB. That's a lot, I think, although the application is really small (about 500 lines of code).
Desired functionality.
I can't believe that this high memory usage is intended.
Mention any other details that might be useful.
Do you need a dump file?
The text was updated successfully, but these errors were encountered: