Issue: getting heap overflow error when trying to call a large number of sequelize calls.
It appears that .map isn't correctly garbage-collecting when being run in concurrency mode.
This code snippet fails:
let trims = [...]; // length is about 50,000
return models.sequelize.transaction((t) => {
  return Promise.map(trims, (trim) => {
    // sequelize
    return models.Trim.upsert(trim, {transaction: t});
  }, {concurrency: 2500});
});
This code snippet is successful:
let trims = [...]; // length is about 50,000
let batches = [];
while(trims.length) {
  batches.push(trims.splice(0, 2500));
}
return models.sequelize.transaction((t) => {
  return Promise.each(batches, (batch) => {
    return Promise.map(batch, (trim) => {
      return models.Trim.upsert(trim, {transaction: t}));
    });
  });
});
What is it about .map that prevents the first snippet from correctly garbage collecting?
Is there a way to fix that code snippet so that it will work correctly without overflowing the heap?
node v6.8.0 bluebird v3.4.6 sequelize v3.27.0
