We run tests in separate processes and a few of our test suites contain more than 20 files. How can we limit (instead of increase) the amount of memory a Node.js process uses to
Useful links:
nodejs decrease v8 garbage collector memory usage
https://groups.google.com/forum/#!topic/nodejs/IYsQ_bXlzcg
https://www.quora.com/How-does-Node-js-do-memory-allocation
Options to be considered:
–nouse-idle-notification
–expose-gc + gc() function from your code.
–max-old-space-size
–max-new-space-size
--max-semi-space-size
Also to decrease memory, less memory consuming algorithms can be used, the code can be more GC friendly. Also native C++ modules can help, but check them thoroughly for memory leaks and errors with some valgrind.
Also quotes from OS can be applied to kill processes which exceed some memory limits.
I know, without some concious option descriptions this answer is not so usefull, but I not very good learned them for now, so this "answer" is just a direction.