Skip to content

Instantly share code, notes, and snippets.

@pagodajosh
pagodajosh / gist:6977727
Last active December 25, 2015 12:39
A program that streams and discards a file (~200 Mb), followed by the output. Notice that the `rss` memory never goes down a significant amount
var fs = require('fs'),
hold = function(){
console.log(process.memoryUsage())
var str = fs.createReadStream("/Users/pagodajosh/Downloads/install53.iso")
str.on('readable',str.read)
str.on('end',function(){
console.log(process.memoryUsage())
})
}