Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

failing test for memory usage

  • Loading branch information...
commit 3a476ba6325d3de5984856f28e631b4a1581ac2d 1 parent c48a9a2
@dominictarr authored
Showing with 8 additions and 4 deletions.
  1. +8 −4 test/memory.js
View
12 test/memory.js
@@ -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')
@@ -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)
//*/
Please sign in to comment.
Something went wrong with that request. Please try again.