Skip to content

Instantly share code, notes, and snippets.

@user24
Created September 2, 2011 17:55
Show Gist options
  • Save user24/1189300 to your computer and use it in GitHub Desktop.
Save user24/1189300 to your computer and use it in GitHub Desktop.
Node memory leak?
var foo = [];
setInterval(function() {
foo.push(Math.random());
if(foo.length > 200) {
foo = foo.slice(-200);
}
console.log(foo.length);
}, 10);
@user24
Copy link
Author

user24 commented Sep 2, 2011

$ node leak.js > leak.log &
$ top

and watch the memory usage climb. I don't fully understand why, and I don't know if this is a purely node issue...

@user24
Copy link
Author

user24 commented Sep 3, 2011

This is in node v0.4.9

Seems to be fixed in v0.4.11, am testing

@user24
Copy link
Author

user24 commented Sep 4, 2011

I don't know what to believe any more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment