"ng build --prod" can consume all available RAM
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Evergreen | Status tracked in Main | |||||
3.10 |
Fix Released
|
Medium
|
Unassigned | |||
3.9 |
Fix Released
|
Medium
|
Unassigned | |||
Main |
Fix Released
|
Medium
|
Unassigned |
Bug Description
Found when installing stock-ish master servers for feedback fest. When running the "ng build --prod" step on a server with 4GB RAM/1 GB swap, the process is halted with the easy-to-miss message "Killed":
39% building 245/247 modules 2 active ...eg2/
Increasing swap to 4GB on each server resolved the immediate issue, but further research shows that this is not an unheard-of issue in NodeJS/Angular projects:
https:/
Apparently, garbage collection can be explicitly controlled with the "max-old-
https:/
It would be nice to see confirmation of the issue before making any drastic changes, but perhaps we can document the problem and/or hard-code a sane default somewhere?
Output of "ng --version":
Angular CLI: 8.3.12
Node: 12.13.0
OS: linux x64
Angular: 8.2.11
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-
... router
Package Version
-------
@angular-
@angular-
@angular-
@angular-
@angular-
@angular-
@angular/cli 8.3.12
@angular/http 7.2.15
@ngtools/webpack 8.3.12
@nguniversal/
@schematics/angular 8.3.12
@schematics/update 0.803.12
rxjs 6.5.3
typescript 3.5.3
webpack 4.39.2
tags: | added: performance |
tags: | added: angular |
Changed in evergreen: | |
status: | New → Confirmed |
assignee: | nobody → Jane Sandberg (sandbergja) |
tags: | added: documentation |
Changed in evergreen: | |
assignee: | nobody → Andrea Neiman (aneiman) |
I'm curious if the new option to use esbuild rather than webpack in Angular 14 might help (https:/ /blog.angular. io/angular- v14-is- now-available- 391a6db736af), once we do that upgrade (bug 1982376)