Skip to content
This repository has been archived by the owner on Dec 4, 2018. It is now read-only.

Commit

Permalink
failing test for memory usage
Browse files Browse the repository at this point in the history
  • Loading branch information
dominictarr committed Dec 12, 2012
1 parent c48a9a2 commit 3a476ba
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions test/memory.js
Expand Up @@ -37,10 +37,11 @@ while(l --)
//console.log('objs', objs)

//return
var I = 0
from(function (i, next) {
if(i > 1000000) return this.emit('data', ']'), this.emit('end')
if(i > 1000) return this.emit('data', ']'), this.emit('end')
if(!i) this.emit('data', '[\n')

I = i
this.emit('data', objs[~~(Math.random()*objs.length)])
this.emit('data', '\n,\n')

Expand All @@ -57,9 +58,12 @@ from(function (i, next) {

// .pipe(fs.createWriteStream('/tmp/test-reverse'))
//
probe.on('data', console.log)

setInterval(function () {
console.log(process.memoryUsage())
var mem = process.memoryUsage()
console.log(mem, I)
if(mem.heapUsed > 200000000)
throw new Error('too much memory used')
console.log(mem)
}, 1e3)
//*/

0 comments on commit 3a476ba

Please sign in to comment.