Ember-cli build memory usage risks failure (OOM) on minimum instance size

The reason we added that flag was that Node’s own OOM killer was killing the build - 500M wasn’t enough. Happy to try tweaking it to 1.5G - I just tried it on my droplet and it seems to work ok. In fact, it seems even 1.0G is enough.

I tried tracking the memory usage with different max_heap sizes:

(while(true); do (free -m -t | grep Total | awk '{print $3}') && sleep 0.5; done) | tee 1000mb.csv

Shows this usage during the build:

There was very little difference in build time, but the 1GB and 1.5GB limits clearly produce less overall usage. As expected, the time output shows significantly fewer “Major page faults” when the node limit is lower.

It’s curious that the difference between 1.5GB and 1GB is so small… :face_with_monocle:

In any case, I agree decreasing the limit is a good idea. To make sure it doesn’t affect the build performance on higher-spec machines, I think we should only override the limit when we know it’s too low. Otherwise, we can let Node use its default.

Here’s a PR - we’ll try and get this merged soon. Thanks for raising this @Ed_S!

4 Likes