joyent/node — pull request #3208 by Filirom1 (2012-05-02 17:03:45+00:00)
Title: Mem leak timeout

Hi,

For me the branch [http-memleak](https://github.com/joyent/node/tree/http-memleak) works well, but I still have a memory leak when I use setTimeout

http.get({
hostname: 'localhost',
pathname: '/index.html?' + Math.random(),
port: 3000,
protocol: 'http:'
}, cb).on('error', function(e) {
cb(e);
}).setTimeout(10, function(){
console.log('nothing here')
})

This pull request fix the gist issue:

node --expose-gc maxired.js
webkit-devtools-agent started on 0.0.0.0:1337
We should do 18 requests
3MB used
Done: 0/18, not yet GC: 0
Got error: socket hang up
Got error: socket hang up
Got error: socket hang up
Got error: socket hang up
Got error: socket hang up
Got error: socket hang up
Got error: socket hang up
Got error: socket hang up
Got error: socket hang up
Got error: socket hang up
Got error: socket hang up
Got error: socket hang up
Got error: socket hang up
Got error: socket hang up
Got error: socket hang up
Got error: socket hang up
Got error: socket hang up
Got error: socket hang up
90MB used
Done: 18/18, not yet GC: 0
all requests done, memory should be collected by now ?
3MB used
Done: 18/18, not yet GC: 0
all requests done, memory should be collected by now ?

Big up @Maxired