Skip to content

Instantly share code, notes, and snippets.

@bnoordhuis
Created November 21, 2012 20:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bnoordhuis/15bee6a68eaca4f70b10 to your computer and use it in GitHub Desktop.
Save bnoordhuis/15bee6a68eaca4f70b10 to your computer and use it in GitHub Desktop.
var vm = require('vm');
function run() {
var obj = {}, ctx = vm.createContext();
obj.ctx = ctx;
ctx.obj = obj;
vm.Script.runInContext('', ctx);
}
for (var i = 0; i < 1e5; i++) {
run();
if (i % 1000 == 0) console.log(process.memoryUsage());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment