Closed fmancuso closed 1 week ago
Unforunyley without a memory snapshot there is nothing that we can inveiagte, ou can generate a memory snapshot by uisig the below command.
node --heapsnapshot-near-heap-limit=1 node_modules/@angular/cli/lib/init.js build
I tried with the node options to create heap snapshot but it create an empty file
After 2 hours the empty file became a 5GB file, you can find it here: https://drive.google.com/file/d/1lpiqn4R6q7o3BIAix8LtlsFYW8n_QKJx/view?usp=drive_link
Edit: I tried to open the heap snapshot but it gave me error. I tried running the command: node --heap-prof node_modules/@angular/cli/lib/init.js build and I attach the generated .heapprofiles here: Heapprofile.zip
+1 Here for this as well
I've noticed builds are slower and it's more memory hungry too, multiple reloads over time cause heavy memory pressure. the Facebook team is rewriting the react compiler in rust, maybe it's time to consider doing the same here... I am using biomejs instead of eslint and the difference in memory/cpu usage was dramatic.
This happens to me when no package-lock.json. Did you update npm as well? https://github.com/npm/cli/issues/7276
Edit: Sorry for any confusion, I get the same out of memory error during npm install, not building, so ignore my comment
In my case it turned out to be a problem due to the change from node-sass to sass. I had to replace a lot of the @import with @use as suggested by sass, the amount of RAM has decreased a lot, it still continues to be slower than before the upgrade. Before the upgrade the build went up to a maximum of 4gb now it goes up to 5.5gb in fact I had to pass the option --max-old-space-size=8192 to avoid problem. In any case I would investigate why there is this increase in RAM required.
I hope it can be useful to someone.
Closing because it seems the issue has been resolved.
Command
build
Is this a regression?
The previous version in which this bug was not present was
12
Description
After upgrading from angular 12 to angular 17 the build command started to go in Out of memory.
Minimal Reproduction
I cannot provide a minimal reproduction as I would have to upload my entire project.
Exception or Error
Your Environment
Anything else relevant?
The components and the various file in the project are the same. Previous the upgrade the maximum quantity of RAM that the process took up was 4 GB now it grows without limits. I tried to take a memory heap dump but without success as the dump was getting stuck