Skip to content

Instantly share code, notes, and snippets.

@matomesc
Created March 3, 2012 20:20
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 matomesc/1967997 to your computer and use it in GitHub Desktop.
Save matomesc/1967997 to your computer and use it in GitHub Desktop.
why does child memory keep growing?
var cp = require('child_process');
if (!process.send) {
// master
var child = cp.fork('./test.js');
child.on('message', function (msg) {
process.stdout.write(msg);
});
} else {
// child
while (true) {
process.send('hey there\n');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment