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 less than say 300MB? If we don't limit memory, we could use up to 20x500MB, which is about 10GB, which is too much memory.
I can find a few articles online about increasing memory, but I can't find anything on limiting memory per process.
Specifically, we are using the core child_process module to create child processes and I guess we need some flag or arg to pass to the cp's to designate a memory cap of sorts.