-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Allocation failed - process out of memory #3023
Comments
reaction build x
results in Allocation failed - process out of memory
reaction build x
-or- reaction test
results in Allocation failed - process out of memory
Try adding this to your Circle config... cb6e9e1 And when local... docker build --build-arg TOOL_NODE_FLAGS="--max-old-space-size=2048" -t custombuild . |
Thanks to @jshimko we've got some successes in the circleCI builds: |
These numbers definitely need to be tweaked, I have a machine that will build with 2047, but not 2048. We have certainly got a working workaround. There is an npm module here that just adds this flag to all node calls. But I'm not ready to close this issue yet. There is a memory leak in building one of the node modules and that might get worse and prevent builds in the future, and is certainly going to affect our newcomers as they try out reaction. |
This workaround did the trick for me |
the above works for
|
@jshimko is your recommendation to use |
it appears so. Though, that is not a deprecation per se, which would be letting people know that this feature would not be supported in the future while it continues to work. |
As of 0.16.1, the build command has been deprecated and there is a message that tells you to use |
reaction build x
-or- reaction test
results in Allocation failed - process out of memory
To summarize this issue, it appears to be happening because the v8 engine in Node has fairly low default memory allotments for a single Node process. If you take a look at the Node source for v4.x (which the current release of Reaction uses), you can see the default is 700MB for 32bit machines and twice that (1.4GB) for 64bit machines ( So, the current solutions for adjusting this in Reaction are either setting this environment variable in development... # You can try changing the amount, but FYI, more is not necessarily better
export TOOL_NODE_FLAGS="--max-old-space-size=2048"
# start Reaction
reaction
# or all in one line
TOOL_NODE_FLAGS="--max-old-space-size=2048" reaction Or this when you run a Docker build... docker build --build-arg TOOL_NODE_FLAGS="--max-old-space-size=2048" -t mybuild . Also worth noting is that some people have said that the update to Meteor 1.6 (with Node 8) has made this issue go away for them. So you could also try running our work-in-progress PR branch for Meteor 1.6 and see if the app starts without setting these flags. To test... reaction init -b meteor-1.6 reaction-1.6
cd reaction-1.6
reaction More info on https://futurestud.io/tutorials/node-js-increase-the-memory-limit-for-your-process |
Also worth noting is Meteor didn't add support for 64bit Windows until a few weeks ago. This means the default Node memory allocation on Windows machines (700MB) is half of what everyone on 64bit machines gets by default. That certainly may explain why Windows users appear to run into this issue more often. It is now available in Meteor 1.6, but Windows users should be aware that you need to reinstall Meteor from scratch to enable 64bit support. See the release blog post for more detail (Windows section is toward the bottom)... https://blog.meteor.com/announcing-meteor-1-6-abf30f29e2c6
And note the updated install instructions for Windows... |
@jshimko that definitely explains the low memory end on windows. However, there are still many issues where I've seen a 64-bit linux machine with monstrous amounts of ram fail with a ridiculous line like:
of note approaching 32 gigs of ram should be way beyond what is necessary here, and yet I've seen that exact setup fail. I think the best solution is to follow @jshimko and the reaction team with their circleCI builds, once you get it setup, it works just fine. But what happens when circleCI changes out their underlying architecture or switch server farms and all of our builds stop? I'm certainly investigating other build solutions. |
@joshuacox yeah, as I mentioned in the code comments above, more is not necessarily better. For example, when it set it to |
just a little extra info I've got two shells open at the moment and one is a
in my other shell I can
|
Since this issue has the above workarounds and is essentially a Meteor build tool issue, we're going to close this issue. |
Expected behavior
Build a custom image from a default checkout of reaction with no modifications
Actual Behavior
CircleCI documents my build failure here
that is on the same commit as 8984 here which passed, yet mine fails.
I have another branch which is actually passing. However, it is using meteor 1.5.1
There are many other builds there too. I believe the only ones that have passed so far have been using meteor 1.5.1, like this one, which is identical to this one except the latter is 1.5.2.1
Steps to Reproduce the Behavior
Fork reaction, make a new circleCI account, add docker env vars, build from master
-or-
Versions
There is also a forum post where I've been documenting this issue for a few weeks now.
I've got a good number of machines running ubuntu zesty and xenial, debian stretch, and arch linux that all exhibit this behavior (most of which have tons of available RAM), with circleCI also doing the same.
CirclleCI
Travis-CI
The text was updated successfully, but these errors were encountered: