clean.js is just 75x faster than cleanSlow.js :D
test/cleanTest.js:
big-object with cleanSlow.js 49 926ms
big-object with clean.js 669ms
clean.js is just 75x faster than cleanSlow.js :D
test/cleanTest.js:
big-object with cleanSlow.js 49 926ms
big-object with clean.js 669ms
(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
{ | |
cluster_name: "search-bench", | |
status: "green", | |
timed_out: false, | |
number_of_nodes: 2, | |
number_of_data_nodes: 2, | |
active_primary_shards: 84, | |
active_shards: 168, | |
relocating_shards: 0, | |
initializing_shards: 0, |
This is my first nodejs C addon.
I am not fluent in C, use it with caution.
Inspired by:
Run it like this