Last active
August 29, 2015 14:12
-
-
Save briancavalier/9895e6e4d2dd31666612 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var Promise = require('when').Promise; | |
| var i = 0; | |
| // Recursively create an infinite chain of promises | |
| next(); | |
| function next() { | |
| return new Promise(function (resolve) { | |
| i++; | |
| if (i % 100000 === 0) { | |
| global.gc(); | |
| console.log(process.memoryUsage()); | |
| } | |
| setImmediate(resolve); | |
| }).then(next); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { rss: 19595264, heapTotal: 10324992, heapUsed: 2859328 } | |
| { rss: 32559104, heapTotal: 22907904, heapUsed: 3208576 } | |
| { rss: 51130368, heapTotal: 40717056, heapUsed: 3221776 } | |
| { rss: 52178944, heapTotal: 41748992, heapUsed: 3177160 } | |
| { rss: 52178944, heapTotal: 41748992, heapUsed: 2869192 } | |
| { rss: 52178944, heapTotal: 41748992, heapUsed: 2821008 } | |
| { rss: 52178944, heapTotal: 41748992, heapUsed: 2870520 } | |
| { rss: 52178944, heapTotal: 41748992, heapUsed: 2887096 } | |
| { rss: 52178944, heapTotal: 41748992, heapUsed: 2887600 } | |
| { rss: 52178944, heapTotal: 41748992, heapUsed: 2887832 } | |
| { rss: 52178944, heapTotal: 41748992, heapUsed: 2880312 } | |
| { rss: 52178944, heapTotal: 41748992, heapUsed: 2823736 } | |
| { rss: 52178944, heapTotal: 41748992, heapUsed: 2871488 } | |
| { rss: 52178944, heapTotal: 41748992, heapUsed: 2887760 } | |
| { rss: 52178944, heapTotal: 41748992, heapUsed: 2887792 } | |
| { rss: 52178944, heapTotal: 41748992, heapUsed: 2887664 } | |
| { rss: 52178944, heapTotal: 41748992, heapUsed: 2880632 } | |
| { rss: 52178944, heapTotal: 41748992, heapUsed: 2824584 } | |
| { rss: 52178944, heapTotal: 41748992, heapUsed: 2872952 } | |
| { rss: 52178944, heapTotal: 41748992, heapUsed: 2889104 } | |
| { rss: 52178944, heapTotal: 41748992, heapUsed: 2889608 } | |
| { rss: 52178944, heapTotal: 41748992, heapUsed: 2889016 } | |
| { rss: 52178944, heapTotal: 41748992, heapUsed: 2881352 } | |
| { rss: 52178944, heapTotal: 41748992, heapUsed: 2824504 } | |
| { rss: 52178944, heapTotal: 41748992, heapUsed: 2872008 } | |
| { rss: 52178944, heapTotal: 41748992, heapUsed: 2888680 } | |
| { rss: 52178944, heapTotal: 41748992, heapUsed: 2888696 } | |
| { rss: 52297728, heapTotal: 41748992, heapUsed: 2892544 } | |
| { rss: 52297728, heapTotal: 41748992, heapUsed: 2885768 } | |
| { rss: 52297728, heapTotal: 41748992, heapUsed: 2829680 } | |
| { rss: 52297728, heapTotal: 41748992, heapUsed: 2878616 } | |
| { rss: 52297728, heapTotal: 41748992, heapUsed: 2895328 } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment