Without doing a DOS on Google it still leaks:
[romain@myhost trace-memory-leaks]$ node --expose-gc gistfile1.js
We should do 5 requests
3MB used
Done: 0/5, not yet GC: 0
24MB used
Done: 5/5, not yet GC: 5
yum install sudo man unzip curl gcc-c++ screen rpm-build gettext-devel | |
mkdir -p /usr/src/redhat/SOURCES | |
mkdir -p /usr/src/redhat/SPECS | |
curl -sR -o /usr/src/redhat/SPECS/tar.spec https://raw.github.com/gist/1241902/tar.spec | |
curl -sR -o /usr/src/redhat/SOURCES/tar-1.26.tar.bz2 ftp://ftp.gnu.org/gnu/tar/tar-1.26.tar.bz2 | |
rpmbuild -ba /usr/src/redhat/SPECS/tar.spec |
(function () { | |
'use strict'; | |
var vows = require('vows'), | |
assert = require('assert'); | |
vows.describe('some test').addBatch({ | |
'test level 1': { | |
topic: function () { | |
this.callback(null, 1); |
Without doing a DOS on Google it still leaks:
[romain@myhost trace-memory-leaks]$ node --expose-gc gistfile1.js
We should do 5 requests
3MB used
Done: 0/5, not yet GC: 0
24MB used
Done: 5/5, not yet GC: 5
An other memory leak with socket hang up
# node --expose-gc leak.js
webkit-devtools-agent started on 127.0.0.1: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
I am actually playing on the branch https://github.com/joyent/node/tree/http-memleak
Without setTimeout it works like a charm,
node --expose-gc gistfile1.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
http.get + req.on('error', function(){})
seems to provoke a memory leak:
node --expose-gc leak.js
We should do 5 requests
2MB used
Done: 0/5, not yet GC: 0
26MB used
Done: 5/5, not yet GC: 5
all requests done, memory should be collected by now ?
26MB used
node --expose-gc leak.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: undefined | |
Got error: undefined | |
Got error: undefined | |
Got error: undefined | |
Got error: undefined |
moved here
var http = require("http"), | |
url = require("url"), | |
path = require("path"), | |
fs = require("fs") | |
port = process.argv[2] || 8888; | |
http.createServer(function(request, response) { | |
var uri = url.parse(request.url).pathname | |
, filename = path.join(process.cwd(), uri); |