-
Notifications
You must be signed in to change notification settings - Fork 12k
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
Build fails with JavaScript heap out of memory #12645
Comments
I think the difference between v6 and v7 is the bug reported in #12646 as in that issue production builds are taking longer, which usually indicated that more code is being processed and more memory is needed. The general issue for running out of memory is #5618. As projects grow bigger, they use more memory, and might need to increase the default memory limit. There's more information on this in #5618 (comment). In your case the only thing you did was to update from v6 to v7 and it should not need significantly more memory than before. I'll look at that problem in #12646. |
allows build to complete, just need to know why my bundle has increase by 260kb |
The same exact behaviour here. And the same solution worked...thank you dottodot! |
try to modify the files and replace their contents with the following: (in the folder : node_modules\bin) Modify ng.cmd:
Modify ngc.cmd :
|
My team was facing the same issue and this is how we resolved. While building a project just use this command instead of
|
increase maximum memory allocated in angular.json |
I've faced this same problem recently and came across to this thread but my problem was with Syntax
Example
Why size is 16000 in max-old-space-size?Basically, it varies depends on the allocated memory to that thread as per your node settings. How to verify and give right size?This is basically stay in our engine
|
I am facing a similar issue on our app as well. Angular 8.1.2
|
Does anyone know if this is due to having just one gigantic module for an application? Our team ran into this issue and we have just 1 app module with 30+ routes and many components and i was curious if breaking the application down into smaller modules would help avoid the out of memory issue during source mapping? |
Sourcemap processing is unfortunately highly memory intensive. Breaking a very large output bundle into smaller ones via lazy routes may not completely alleviate the issue but should definitely help mitigate it. It may also provide a benefit to end users of the application as well since less code needs to be downloaded and executed prior to first interaction. |
Thanks @clydin. Im aware of the benefits and we plan to do it but was more curious if have still seen this with many modules as well? I presume each chunked module would get sourcemapped separately right? |
i have the save problem Angular CLI 8.1.0 |
Same issue here too:
The error:
|
This is why? |
Why is this issue closed? |
The error went away after upgrading to node |
Just upgraded to node |
Ok Ths!
发自我的iPhone
…------------------ Original ------------------
From: Kyle <[email protected]>
Date: Wed,Oct 2,2019 1:43 AM
To: angular/angular-cli <[email protected]>
Cc: zhangwk02 <[email protected]>, Comment <[email protected]>
Subject: Re: [angular/angular-cli] Build fails with JavaScript heap out of memory (#12645)
Just upgraded to node v12.10.0 and it didn't go away for us, unfortunately.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I ran into this problem building an Angular project within a Docker container. I made sure to use current version of node (12.12), and I had to increase the RAM available to docker. |
Here too. Working with Docker with 2GB RAM. It worked fine with node 10, but reaches the memory limit with node 12. |
Had to deal with an ancient Jenkins server, so upgrading node wasn't really an option. Downgrading angular cli to 8.2.2 worked in this case. I suspect the out of memory error was caused by a change introduced in angular 8.3.x. The parallel bundle processing during Improve performance of parallel bundle processing [8.3.x] |
In my case I'm using angular cli 7.3.9. |
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 or Feature Request (mark with an
x
)Command (mark with an
x
)Versions
npm 6.4.1
yarn 1.9.4
Angular CLI: 7.0.1
Node: 8.12.0
OS: darwin x64
Angular: 7.0.0
... animations, cdk, common, compiler, compiler-cli, core, forms
... http, language-service, material, material-moment-adapter
... platform-browser, platform-browser-dynamic, platform-server
... router, service-worker
Package Version
@angular-devkit/architect 0.10.1
@angular-devkit/build-angular 0.10.1
@angular-devkit/build-optimizer 0.10.1
@angular-devkit/build-webpack 0.10.1
@angular-devkit/core 7.0.1
@angular-devkit/schematics 7.0.1
@angular/cli 7.0.1
@angular/pwa 0.10.1
@ngtools/webpack 7.0.1
@schematics/angular 7.0.1
@schematics/update 0.10.1
rxjs 6.3.3
typescript 3.1.3
webpack 4.19.1
Repro steps
run ng build client --prod
The log given by the failure
Desired functionality
v6 doesn't have any issue building the same app.
Mention any other details that might be useful
I can't shared any code as it's a big client project, and I suspect it the size that's causing the issue as basic apps build ok.
The text was updated successfully, but these errors were encountered: