Possible ipc memory leak


#1

I seem to have encountered a memory leak in the browser process using ipc.

The page in the window has the following script and nothing else:

var ipc = require('ipc');
setInterval(function() {
    ipc.send("message", "the quick brown fox jumps over the lazy dog");
}, 500 );
ipc.on("message", function(message) {
    // no - op
});

The relevant code in the brower process is (in coffeescript):

    ipc = require 'ipc'

    ipc.on 'message', (event, args) =>
      @onIpcMessage(event, args)

    onIpcMessage: (event, args) =>
     @sendIpcMessage event.sender, args

   sendIpcMessage: (target, message) ->
     target.send "message", "received: " + message

Initially I had logging in place to verify message flow was operating as expected.

Running this code (under window 7) consistently shows memory growth of 10-15mb an hour. I ran it overnight night and saw memory growth of ~190mb.

The memory growth was only in the browser process (I logged process.pid to verify which process was growing).

After disabling the setInterval ipc.send - no memory growth occurred.

Any other explanation for this behavior other than memory leak?


#2

It’s probably best to report this as a bug on the atom-shell repository, especially since you have a reproducible scenario.