{"action":"opened","issue":{"url":"https://api.github.com/repos/bevry/taskgroup/issues/19","labels_url":"https://api.github.com/repos/bevry/taskgroup/issues/19/labels{/name}","comments_url":"https://api.github.com/repos/bevry/taskgroup/issues/19/comments","events_url":"https://api.github.com/repos/bevry/taskgroup/issues/19/events","html_url":"https://github.com/bevry/taskgroup/issues/19","id":62773051,"number":19,"title":"Unusually large amount of memory usage","user":{"login":"pflannery","id":1727302,"avatar_url":"https://avatars.githubusercontent.com/u/1727302?v=3","gravatar_id":"","url":"https://api.github.com/users/pflannery","html_url":"https://github.com/pflannery","followers_url":"https://api.github.com/users/pflannery/followers","following_url":"https://api.github.com/users/pflannery/following{/other_user}","gists_url":"https://api.github.com/users/pflannery/gists{/gist_id}","starred_url":"https://api.github.com/users/pflannery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pflannery/subscriptions","organizations_url":"https://api.github.com/users/pflannery/orgs","repos_url":"https://api.github.com/users/pflannery/repos","events_url":"https://api.github.com/users/pflannery/events{/privacy}","received_events_url":"https://api.github.com/users/pflannery/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-18T18:58:06Z","updated_at":"2015-03-18T18:58:06Z","closed_at":null,"body":"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.\r\nSo its seems that task group is generating an unusually large amount of memory overhead.\r\n\r\nHere the code I was testing with.\r\n```js\r\nvar TaskGroup = require(\"taskgroup\").TaskGroup;\r\nvar testArray = Array(10000).join().split(',');\r\nvar grp = TaskGroup.create();\r\n\r\ntestArray.forEach(function(value, index) {\r\n  grp.addTask(function() {\r\n    console.log(\"task\"+index);\r\n  });\r\n  /*\r\n  setImmediate(function() {\r\n    console.log(\"task\"+index);\r\n  });\r\n  */\r\n});\r\n\r\ngrp.run();\r\n```\r\n\r\nI only tested on Windows 8.1 so not sure what a Linux box will output"}}