Skip to content

Javascript heap out of memory #262

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

Closed
JohnGalt1717 opened this issue May 15, 2017 · 5 comments
Closed

Javascript heap out of memory #262

JohnGalt1717 opened this issue May 15, 2017 · 5 comments

Comments

@JohnGalt1717
Copy link

See here: PatrickJS/PatrickJS-starter#1498

There are multiple reports of this but it comes down to the following changes to fix this:

Add --max_old_space_size=4096 to the node commands in the .csproj

update the following in the package.json:

"build:dev": "npm run webpack -- --progress --color",
"build:aot": "npm run webpack -- --env.aot --env.client & npm run webpack --env.aot --env.server",
"webpack": "node --max_old_space_size=4096 node_modules/webpack/bin/webpack.js"
@MarkPieszak
Copy link
Member

MarkPieszak commented May 17, 2017

Very interesting, I haven't seen this one actually, if it works it might be a good addition to the repo! Want to put in a quick PR so everyone can have it? 👍 👍

Linked bug:
angular/angular-cli#5618

@JohnGalt1717
Copy link
Author

It gets worse... I created a separate webpack.config.production.js to get around the chunking issue. If uglify-js is enabled this will fail with the above error even with 16 gb of memory allocated. (disabling it works but of course tree shaking, even the basics of it that do work doesn't happen and you end up with massive files.)

@naveedahmed1
Copy link

Its still an open issue with Angular team, angular/angular#12184 and probably the solution currently is to increase max_old_space_size. It would be better to add it in docs because some times you will have to increase the max_old_space_size even from 4096.

@Adondriel
Copy link
Contributor

Feel free to re-open if you encounter this issue, for now i'm going to close the issue, since we can't really control this one.

@codehippie1
Copy link

This issue hits hard on Azure Agent builds more often. A possible resolution using an npm package is listed here: https://developercommunity.visualstudio.com/content/problem/398343/azure-devops-pipeline-fatal-error-ineffective-mark.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants