Skip to content

Instantly share code, notes, and snippets.

@isaacs
Created June 8, 2013 00:05
Show Gist options
  • Save isaacs/5733238 to your computer and use it in GitHub Desktop.
Save isaacs/5733238 to your computer and use it in GitHub Desktop.
$ cat t.js
gc();
var before = process.memoryUsage();
var express = require(process.argv[2]);
gc();
var after = process.memoryUsage();
var diff = {}
for (var i in before) diff[i] = after[i] - before[i]
console.log(before)
console.log(after)
console.log(diff)
$ node --expose-gc t.js express
{ rss: 11915264, heapTotal: 6163968, heapUsed: 1460672 }
{ rss: 19935232, heapTotal: 10324992, heapUsed: 3298312 }
{ rss: 8019968, heapTotal: 4161024, heapUsed: 1837640 }
$ node --expose-gc t.js request
{ rss: 11804672, heapTotal: 6163968, heapUsed: 1460672 }
{ rss: 20979712, heapTotal: 15551232, heapUsed: 4157032 }
{ rss: 9175040, heapTotal: 9387264, heapUsed: 2696360 }
@Swatinem
Copy link

Swatinem commented Jun 8, 2013

So request is heavier than express, haha.
How about superagent?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment