angular: Node runs out of memory running our builds
I’ve seen it crash on JS bundle tasks and build/pure-packages.dart
. @hterkelsen reports it crashing on JS sourcemaps.
Workaround: node --max-old-space-size=2000 ./node_modules/.bin/gulp {TASK}
(2000 is 2GB)
- fix the underlying issue
- remove the heap config workaround from
scripts/publish/npm_publish.sh
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Reactions: 2
- Comments: 24 (15 by maintainers)
Commits related to this issue
- build(npm_publish.sh): run gulp via node --max-old-space-size=1900 to workaround #5229 — committed to angular/angular by IgorMinar 9 years ago
- 1e74058 build(npm_publish.sh): run gulp via node --max-old-space-size=1900 to workaround #5229 — committed to angular/angular by IgorMinar 9 years ago
- 1e74058 build(npm_publish.sh): run gulp via node --max-old-space-size=1900 to workaround #5229 — committed to angular/angular by IgorMinar 9 years ago
- chore(circleci): use a github token when running tsd Also increase the heap size limit as a workaround for https://github.com/angular/angular/issues/5229 Fixes #6602 — committed to alexeagle/angular by alexeagle 8 years ago
- chore(circleci): use a github token when running tsd Also increase the heap size limit as a workaround for https://github.com/angular/angular/issues/5229 Fixes #6602 — committed to angular/angular by alexeagle 8 years ago
- chore(build): mitigate OOM errors Fixes #5229 — committed to pkozlowski-opensource/angular by pkozlowski-opensource 8 years ago
- chore(build): mitigate OOM errors Fixes #5229 — committed to pkozlowski-opensource/angular by pkozlowski-opensource 8 years ago
Why not allocate more memory to the entire gulp process, rather than start a sub-process? Is it to avoid parts of the build outside of bundling that start to rely on more available heap?
One solution is to use npm run-scripts in the
package.json
so the memory settings are saved with the gulp command to run, eg(I’m trying this now because I have the same issue on Circle, which already uses
npm run build
rather than shell scripts as the build step)on windows environment I needed:
run as usual: