Search code examples
electron

What are these extra processes?


In my Electron app, I have my main process and two renderer windows open. Why does Task Manager show 8 "electron.exe" processes? I would expect it to be 3.

Thanks.


Solution

  • Extra processes are electron listeners.

    A new process will spawn every time you add a listener to ipcMain or ipcRenderer.

    Example:

    ipcRenderer.on("data", (e, data) => {
      console.log("this will spawn a process")
    })
    

    More:

    • If you start your app:

      • enter image description here
    • If you add a listener:

      • enter image description here
    • If a window is visible, Windows joins them all in a group:

      • enter image description here

    Just wondering if there's any way to specify a process id or something to join them together...