Closed sangalao closed 11 months ago
Angular v14 is no longer supported. Please consider updating to a more recent and supported version. There have been significant improvements in build performance since the v14 timeframe. For more information regarding currently supported Angular versions, please see: https://angular.dev/reference/releases#actively-supported-versions
If you are still encountering issues after updating, please open an issue with updated project information.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.
Command
build
Is this a regression?
The previous version in which this bug was not present was
No response
Description
Hello,
The build command I run for my project is :
This commands runs successfully, but however the NodeJS process for building app takes up to 6GB.
To be more precise, during beginning-middle of building phase it takes less than 4GB, and always at the middle-end of building phase, it goes up to 6GB just before end of successful build.
To start investigation, I launched build command with "-trace-gc" option :
I saw, with this option, that there are several Node "V8 isolates" that are created in the same NodeJS process ("V8 isolate" = JS Heap instance, based on Node GC documentation) :
Among those "V8 isolates", with a proper heap for each, 2 of them have particular high heap amount at the same time :
What also have to be noticed is that the second one consumes such a memory ONLY when option "production > optimization > scripts" in "angular.json" is set to true. The "production > optimization > scripts" option in "angular.json" is required for my production performance requirements (minification, tree-shaking, dead-code elimination).
So my questions/remarks are :
The "max_old_space_size" parameter seems to mainly apply to the MAIN V8 isolate, so I'm not able to configure "global" memory consumption during build phase. Is there a parameter to configure the GLOBAL heap used by NodeJS process for building phase ? If not, I think it could be useful to have one, and/or be able to fine-tune memory for all V8 isolates with high memory consumption
I cannot find any documentation explaning the fact that "production > optimization > scripts" option can result in high memory consumption, why it takes such memory, how I could tune it. Is is possible to have such a documentation / explanation ?
I also found this issue about memory limits for several "V8 isolates" in NodeJS, and was wondering whether it could be linked to my issue : worker: resourceLimits overridden by --max-old-space-size
Thanks
Minimal Reproduction
Command run :
Packages :
Exception or Error
No response
Your Environment
Anything else relevant?
Extract of "angular.json" used for production build :
Extract of build logs, with GC events (middle-end of build phase, with 2 V8 isolates having high amount of heap at the same time) :