-
Notifications
You must be signed in to change notification settings - Fork 12k
JavaScript heap out of memory on ng update @angular/core @angular/cli #18109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This most likely relates to a comment here: #18034 (comment) |
@bjornharvold, would you be able to share the project even privately? |
Hi @alan-agius4 Unfortunately not. However, email me at bjorn at harvold dot com and I will send you a "du -h" of the beast. The source code clocks in at 100+ Mb. Cheers |
Hi @bjornharvold, I tried to replicate this locally by adding a while load of application and json files inside a workspace. But didn't manage. Can you please provide a memory dump? |
Hi @alan-agius4 Let me know how I generate one and I will gladly give it to you. |
... also notice that I don't have a src/app default project. All my apps and libraries are under projects folder. Could that be a reason for failure? |
Hi @bjornharvold, the fact that you don't have a root application doesn't have any effect in this case. To generate memory heap snapshots you can try to use
will will open a Chromium browser, go to |
Hi @alan-agius4 I executed your command and it goes as far as here...
|
I tried:
and
They both returned:
So not arriving at the point where it breaks with this. |
@bjornharvold, I updated the above comment, which includes an extra step. |
Hi again @alan-agius4 I executed the updated command above. This time it did execute what we wanted. However, it didn't fail. As I was creating snapshots, Chromium stopped for a second to warn me of an impending "out of memory" error (attaching screenshot) that was about to happen, but the process executed successfully. When I tried to save the last snapshot, Chromium blew up and left me the message at the bottom. I did get a chance to look at the heap dump before I tried saving it. I saw a LOT of "Copyright" strings and string warnings about 3rd party licenses. The dump was about 860Mb and took forever to create. So if I was to play Sherlock Holmes, I would deduce that because I have 143 dependencies and all copyright messages from 3rd parties are being saved somewhere, that there is something going on in that part of the code. I will try to get the heap dump to save one more time but that's what I've got so far.... or it has something to do with the executed script visiting all dependent libraries tsconfigs.
|
I tried to get the out of memory error to happen again but without luck. If I just execute your command above, the style migration does not fail with an out of memory heap exception. |
FYI I got it to migrate without exploding on me by first updating all packages and then do a migrate-only of angular/cli
|
In such case, I am going to leave this open for a couple to days maybe someone else encounters this issue and can provide access to their repository. If no one else provides a reproduction, we’ll have to close this as we are unable to continue investigate this without a reproduction. |
Just wanted to chime in that I'm running into the same issue. I'm afraid I won't be able to share our project repo, though. I will try the workaround suggested by @bjornharvold to first update the package and then do a migrate-only... Some additional info that might help:
|
I solved it by increasing the memory to 30000, and doing following This example uses an update from 9 to 10. Run each step, one at a time: npm i @angular/cli@9 @angular/core@9
node --max_old_space_size=30000 ./node_modules/@angular/cli/bin/ng update @angular/cli --from 9 --migrate-only
ng update @angular/core @angular/cli |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Closing as this should no longer be an issue in v11. |
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. |
🐞 Bug report
Command (mark with an
x
)Is this a regression?
No
Description
Running an update from Angular 9 -> 10 causes a Javascript heap out of memory error on a large project
🔬 Minimal Reproduction
ng update --force @angular/core @angular/cli
OR
node --max_old_space_size=16384 ./node_modules/@angular/cli/bin/ng update --force @angular/core @angular/cli
🔥 Exception or Error
The text was updated successfully, but these errors were encountered: