Skip to content

Instantly share code, notes, and snippets.

@matomesc

matomesc/ipc.js

Created Mar 3, 2012
Embed
What would you like to do?
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