Execute batch of promises in series. Once Promise.all is done go to the next batch
I have an array that contains an array of promises, and each inner array could have either 4k, 2k or 500 promises. In total there are around 60k promises and I may test it with other values as well. Now I need to execute the Promise.all(BigArray[0]) . Once the first inner array is done, I need to execute the next Promise.all(BigArray[1]) and so on and so on. If I try to execute a Promise.all(BigArray) it's throwing: fatal error call_and_retry_2 allocation failed - process out of memory I need to execute it each of promises in series, not in parallel which I think that’s what Node its doing. I