Forked from LesTR/"unexpected" memory management.js
Created
September 12, 2014 10:40
-
-
Save AoJ/987c0aa8a51463ee67e0 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
| (function () { | |
| "use strict"; | |
| var fs = require('fs'), | |
| iterations = 0, | |
| work = function (callback) { | |
| var buffer = '', | |
| i; | |
| console.log('Work ' + iterations); | |
| for (i = 0; i < 50; i += 1) { | |
| //wget https://gist.githubusercontent.com/AoJ/79046572cbc028daab65/raw/4be557ed63be643afaf898197f7dcbabb37630f1/words | |
| buffer += fs.readFileSync('./words'); | |
| } | |
| iterations += 1; | |
| if (iterations < 100) { | |
| // buffer = null; | |
| // process.nextTick(function () { | |
| work(callback); | |
| // }); | |
| } else { | |
| callback(); | |
| } | |
| }; | |
| work(function () { | |
| console.log('Done'); | |
| }); | |
| }()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment