Created
May 14, 2011 18:32
-
-
Save dvv/972495 to your computer and use it in GitHub Desktop.
redis-clients-leaking
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
published 100000 freemem 579334144 | |
published 200000 freemem 524353536 | |
published 300000 freemem 471535616 | |
published 400000 freemem 404111360 | |
published 500000 freemem 345575424 | |
published 600000 freemem 285134848 | |
published 700000 freemem 240693248 | |
published 800000 freemem 175812608 | |
published 900000 freemem 106991616 | |
published 1000000 freemem 54648832 | |
FATAL ERROR: CALL_AND_RETRY_2 Allocation failed - process out of memory |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
published 100000 freemem 577314816 | |
published 200000 freemem 539254784 | |
published 300000 freemem 501288960 | |
published 400000 freemem 465227776 | |
published 500000 freemem 423833600 | |
published 600000 freemem 384573440 | |
published 700000 freemem 347656192 | |
published 800000 freemem 311214080 | |
published 900000 freemem 252170240 | |
published 1000000 freemem 233885696 | |
published 1100000 freemem 182968320 | |
published 1200000 freemem 151224320 | |
published 1300000 freemem 118337536 | |
published 1400000 freemem 75165696 | |
published 1500000 freemem 51761152 | |
published 1600000 freemem 54988800 | |
published 1700000 freemem 52793344 | |
published 1800000 freemem 55742464 | |
published 1900000 freemem 79003648 | |
FATAL ERROR: JS Allocation failed - process out of memory |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
published 100000 freemem 637362176 | |
published 200000 freemem 616194048 | |
published 300000 freemem 591171584 | |
published 400000 freemem 551682048 | |
published 500000 freemem 515620864 | |
published 600000 freemem 476131328 | |
published 700000 freemem 444133376 | |
published 800000 freemem 408326144 | |
published 900000 freemem 363757568 | |
published 1000000 freemem 334807040 | |
published 1100000 freemem 289841152 | |
published 1200000 freemem 254652416 | |
published 1300000 freemem 219631616 | |
published 1400000 freemem 178110464 | |
published 1500000 freemem 137224192 | |
FATAL ERROR: JS Allocation failed - process out of memory |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var freemem = require('os').freemem; | |
var encode = JSON.stringify; | |
var published = 0; | |
var pub = require('redis').createClient().on('drain', go); // rats! drain event fired only twice... | |
var t1 = Date.now(); | |
function go() { | |
var n = 100000; | |
while (n--) { | |
var s = encode({ | |
cid: 0, | |
cmd: Math.random(), | |
data: Math.random() | |
}); | |
pub.publish('timeline', s); | |
published++; | |
} | |
console.error('elapsed', Date.now()-t1, 'published', published, 'freemem', freemem()); | |
//setTimeout(go, 2000); // this works w/o drain event, but the value of timeout is unguessable :) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var freemem = require('os').freemem; | |
var encode = JSON.stringify; | |
var published = 0; | |
// bnoguchi/redis-node | |
//var pub = require('redis-node').createClient(); go(); | |
// mranney/node_redis | |
//var pub = require('redis').createClient().on('ready', go); | |
// fictorial/redis-client | |
var pub = require('redis-client').createClient(); go(); | |
function go() { | |
while (true) { | |
var s = encode({ | |
cid: 0, | |
cmd: Math.random(), | |
data: Math.random() | |
}); | |
pub.publish('timeline', s); | |
published++; | |
if (published % 100000 === 0) console.error('published', published, 'freemem', freemem()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment