-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
Allow max heap size to be configured globally #18889
Comments
You mean something like |
Yes, I suppose that is exactly what I meant. 😃 |
Im glad they had this.. Thanks. However. Id not mind a simple..... memory=grow_as_you_need RIGHT!!??!??!! And while were being this fancy.. How about that's the default.... And the guys that'd like to UBER Tame the memory to be exactly so.. Can customize that. Just a thought!! Still thanks for informing about the flag. Appreciated. |
still no solution for this? I have the same issue |
Where do you enter that? Why does half the internet say Why is there no usable documentation for this project? Google and Github and blogs are full with the same old obvious questions and we're all wasting our time here. |
I've had to create the same thing for my company, I've tried numerous solution, none of them working. So I create a bash script that work on macOS and windows( if you got any terminal simulator like the git bash ) usage if you don't have any bash simulator, on windows you can simply run |
@valex91 That does not seem to work. After setting the environmental variable, opening a new terminal, and running |
did you find any solution yet? |
At the moment certain node processes, e.g. Webpack when building large projects, consistently lead to the out-of-memory error
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
. While it is possible to increase the heap size by calling e.g.node --max-old-space-size=4096 ./node_modules/.bin/webpack
this is not ideal, especially when executing scripts via NPM defined on thepackage.json
'sscripts
field.npm/npm#12238 gives an idea of how cumbersome it is to have to preface every script name with
node --max-old-space-size=4096 ./node_modules/.bin/
. Meanwhile other solutions such as https://github.com/endel/increase-memory-limit are ugly hacks at best.This all could be avoided if Node offered a way to globally configure the max heap size, for instance via an environmental variable or a config file. When using Node for frontend tooling there isn't the luxury of just one or two scripts needing to be launched once and then let run forever. There are tons of different scripts used for all kinds of purposes that developers execute in the course of their daily work, and it would be great if there was a simple way to set the max heap size to be higher for all of them.
The text was updated successfully, but these errors were encountered: