I'm using bluebird v3.3.4 running on node v4.4.0. Leaky code:
const Promise = require('bluebird');
Promise.each(new Array(3000), () => {
const longString = (new Array(1000000)).join('1');
return Promise.resolve(longString);
});
Not leaky code:
const Promise = require('bluebird');
Promise.each(new Array(3000), () => {
const longString = (new Array(1000000)).join('1');
return Promise.resolve(longString).then(() => void 0);
});
It seems that the results of the promises are stored somewhere, but they shouldn't be, at least this is what I understand reading the docs of Promise.each:
Resolves to the original array unmodified, this method is meant to be used for side effects.
Issue is happening on earlier versions of bluebird too.
I'm using bluebird v3.3.4 running on node v4.4.0. Leaky code:
Not leaky code:
It seems that the results of the promises are stored somewhere, but they shouldn't be, at least this is what I understand reading the docs of
Promise.each:Issue is happening on earlier versions of bluebird too.