-
Notifications
You must be signed in to change notification settings - Fork 12k
ng build causes out of memory #19526
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
Hi @vicatcu, I looks like this issue is not related to #18398 since the OOM error is occurring during the building phase. unfortunately, without either a reproduction or sharing the problematic project (even privately) it would be hard for us to investigate what is causing the increase in memory usage in your project. |
I would be happy to share the project privately @alan-agius4 |
Got the invite for the private repo, thanks |
Hi @vicatcu, I tried to had a look at the reproduction you provided however I am unable to start it due to compilation errors. When I run
|
@alan-agius4 right, sorry I forgot you need a file just above the project root called epi-env.js and it can simply contain: |
So I started looking at this today and I did a couple of things;
Side notes you should also consider:
At this point I think using |
Another observations, removing all files from the compilation and adding |
@alan-agius4 thank you so much for looking into this and for your suggestions. I'll look into adding browserlistrc later today. I'm not sure I understand the last comment, as I can't remove '@grapecity/spread-sheets' as a dependency of my project. You are just saying it is implicated on its own as contributing a huge increase in build memory demand? As an aside it's the a way to pass Also just read https://angular.io/guide/deployment re: differential loading and found it illuminating, thanks for the heads up! |
Hi @vicatcu, Yes, using
No, since |
OK, I guess we shall consider this one closed for now then, feel free to reopen if you think there is more to say @alan-agius4. |
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
Command (mark with an
x
)Is this a regression?
Yes, this started happening when I migrated our server from Angular 9 to Angular 11, and from Node 10 to Node 14.
Description
When I run
ng build
on my server, during theGenerating browser application bundles (phase: building)...
message, eventually I get an out of memory crash. This actually happens on my server, which has 2GB or RAM, as well as on my development machine, which has 16GB of RAM.🔥 Exception or Error
🌍 Your Environment
Anything else relevant?
Possibly related to #18398, but I'm not sure how to confirm. I don't think I'm using i18n but I think I am targeting es5.
It doesn't crash if I do
node --max_old_space_size=4096 ./node_modules/@angular/cli/bin/ng build
The text was updated successfully, but these errors were encountered: