Skip to content

An unusually large amount of memory usage #19

@pflannery

Description

@pflannery

When creating 10000 small tasks I find that the process memory peeks around 170MB. When I run the same 10000 tasks with setImmediate it's doesn't go over 40MB.
So its seems that task group is generating an unusually large amount of memory overhead.

Here the code I was testing with.

var TaskGroup = require("taskgroup").TaskGroup;
var testArray = Array(10000).join().split(',');
var grp = TaskGroup.create();

testArray.forEach(function(value, index) {
  grp.addTask(function() {
    console.log("task"+index);
  });
  /*
  setImmediate(function() {
    console.log("task"+index);
  });
  */
});

grp.run();

I only tested on Windows 8.1 so not sure what a Linux box will output

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions