public
Last active

  • Download Gist
gistfile.txt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
$ 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 }

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

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.