Skip to content

Instantly share code, notes, and snippets.

View Filirom1's full-sized avatar

Romain Filirom1

View GitHub Profile
@Filirom1
Filirom1 / README.md
Created March 27, 2012 19:40
A fast object cleaner

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
@Filirom1
Filirom1 / gist:2436310
Created April 21, 2012 10:06 — forked from beatgammit/gist:1871760
Vows breaks on nested topics
(function () {
'use strict';
var vows = require('vows'),
assert = require('assert');
vows.describe('some test').addBatch({
'test level 1': {
topic: function () {
this.callback(null, 1);
@Filirom1
Filirom1 / README.md
Created April 28, 2012 11:45 — forked from vvo/gist:2488897
mem leak ? without google

Without doing a DOS on Google it still leaks:

http://i.imgur.com/tnk7w.png

[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

@Filirom1
Filirom1 / README.md
Created April 30, 2012 17:15 — forked from vvo/gist:2488897
mem leak ? with socket hang up

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

@Filirom1
Filirom1 / README.md
Created May 2, 2012 15:36 — forked from vvo/gist:2488897
mem leak ? with setTimeout

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

@Filirom1
Filirom1 / README.md
Created May 3, 2012 08:28 — forked from vvo/gist:2488897
mem leak ? on('error', function(){

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

@Filirom1
Filirom1 / leak.js
Created May 3, 2012 17:27 — forked from vvo/gist:2488897
mem leak ? timeout and onError with a working HTTP Server
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
@Filirom1
Filirom1 / README.md
Created July 3, 2012 17:31 — forked from kembuco/run-mocha.js
JavaScript: PhantomJS Mocha Scrapper

moved here

@Filirom1
Filirom1 / _cluster-health
Created July 6, 2012 12:40
Unable to join the cluster
{
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,