{"action":"created","issue":{"url":"https://api.github.com/repos/joyent/node/issues/1155","labels_url":"https://api.github.com/repos/joyent/node/issues/1155/labels{/name}","comments_url":"https://api.github.com/repos/joyent/node/issues/1155/comments","events_url":"https://api.github.com/repos/joyent/node/issues/1155/events","html_url":"https://github.com/joyent/node/issues/1155","id":1005020,"number":1155,"title":"Memory leak when loop-referencing objects over contexts","user":{"login":"d-ash","id":686940,"avatar_url":"https://avatars.githubusercontent.com/u/686940?v=3","gravatar_id":"","url":"https://api.github.com/users/d-ash","html_url":"https://github.com/d-ash","followers_url":"https://api.github.com/users/d-ash/followers","following_url":"https://api.github.com/users/d-ash/following{/other_user}","gists_url":"https://api.github.com/users/d-ash/gists{/gist_id}","starred_url":"https://api.github.com/users/d-ash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/d-ash/subscriptions","organizations_url":"https://api.github.com/users/d-ash/orgs","repos_url":"https://api.github.com/users/d-ash/repos","events_url":"https://api.github.com/users/d-ash/events{/privacy}","received_events_url":"https://api.github.com/users/d-ash/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/joyent/node/labels/P-2","name":"P-2","color":"fbca04"},{"url":"https://api.github.com/repos/joyent/node/labels/vm","name":"vm","color":"e10c02"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2011-06-05T11:57:00Z","updated_at":"2015-07-30T15:25:33Z","closed_at":null,"body":"```javascript\r\nvar vm = require('vm');\r\n\r\nfunction run() {\r\n  var obj = {}, ctx = vm.createContext({});\r\n\r\n  obj.__ctx = ctx;\r\n  ctx.__obj = obj;\r\n\r\n  vm.Script.runInContext('var x = 1;', ctx);\r\n}\r\n\r\nfor (var i = 0; i < 100000; i += 1) {\r\n  run();\r\n}\r\n```\r\n\r\nLeak occurs when runInContext() is executed."},"comment":{"url":"https://api.github.com/repos/joyent/node/issues/comments/126369767","html_url":"https://github.com/joyent/node/issues/1155#issuecomment-126369767","issue_url":"https://api.github.com/repos/joyent/node/issues/1155","id":126369767,"user":{"login":"jasnell","id":439929,"avatar_url":"https://avatars.githubusercontent.com/u/439929?v=3","gravatar_id":"","url":"https://api.github.com/users/jasnell","html_url":"https://github.com/jasnell","followers_url":"https://api.github.com/users/jasnell/followers","following_url":"https://api.github.com/users/jasnell/following{/other_user}","gists_url":"https://api.github.com/users/jasnell/gists{/gist_id}","starred_url":"https://api.github.com/users/jasnell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasnell/subscriptions","organizations_url":"https://api.github.com/users/jasnell/orgs","repos_url":"https://api.github.com/users/jasnell/repos","events_url":"https://api.github.com/users/jasnell/events{/privacy}","received_events_url":"https://api.github.com/users/jasnell/received_events","type":"User","site_admin":false},"created_at":"2015-07-30T15:25:33Z","updated_at":"2015-07-30T15:25:33Z","body":"@robraux .. sorry, I'm a bit backlogged on github notifications and just now spotted your ping from a few days ago. I have not yet had the opportunity to dig into the details on this particular problem so I cannot say for sure, but the fix appears to have landed as part of the significant vm module updates that were made when the Contextify functionality was merged in. If that's the case, back porting may be a bit difficult but not impossible if a specific fix can be isolated and landed without introducing any API changes. Unfortunately, I won't have time to look at that myself for at least a couple of weeks so if you'd like to take a look, I'd happily review a PR :-)"}}