Angular 12 compiler memory hungry #42960
Comments
|
This sounds like angular/angular-cli#21381 for which it's not yet clear what the cause is. One of the things that has been established is that Terser in Webpack 5 is no longer forking subprocesses but instead uses Node workers, which operate in the same process and therefore contribute to memory usage of the main process. This was not the case with forked processes, as each process will then have its own memory pool (but the overall memory usage is higher). I notice in your |
@JoostK, yes, I guess so, is there something wrong with that? This is config for a build that runs a on a dev-test server. |
|
No that's fine, I was thinking it was used for live development purposes. I do suspect that it's indeed Terser's memory usage that has been shifted to the main process that is the root cause for the OOM, not the Angular compiler itself. That would be something for the CLI repo to track, which I believe is covered by angular/angular-cli#21381. |
|
Linked: angular/angular-cli#21338 |
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
|
Closing for now as without a repro this isn't actionable for us. Still, it's likely (but I don't know for sure) that it's the reshuffling of Terser processes that has shifted the memory from multiple processes to just a single process. That increases the memory usage of that processed but is a sytem-wide reduction, as there is no longer the overhead of multiple Node processes. |
|
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. |


Which @angular/* package(s) are the source of the bug?
compiler
Is this a regression?
Yes
Description
After upgrading to Angular 12 (from 11)
ng build --configuration devstarted to fail due to lack of memory. The same behavior can be seen on Azure and local environment. I tried to increase--max-old-space-size- still failed for 2GB, passed with 4GB on local machine. Before it was running fine on node's defaults. Probably this is something about sourceMap, because production build with them turned off works fine.angular.json configurations:
Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
ADDED: Full logs from another try: https://pastebin.com/raw/G7YqzXD9
Please provide the environment you discovered this bug in
Anything else?
Should I attach something more?
The text was updated successfully, but these errors were encountered: