Need troubleshooting tips to find why electron (chromium) renderer process doesn't exit properly

I’m troubleshooting an issue while using electron with webviews, where the renderer process for that webview doesn’t close/exit properly when the rest of Electron closes. I’m guessing there is some kind of weird memory leak/reference that is keeping it linked until its too late to close with the main process? The renderer also seems to “leak” when removing the webview from the DOM manually without closing the whole app.

I’m using Electron 6.0.4 (upgraded from Electron 1.x) on Windows 10 and Linux. This issue seems to be limited to the Windows platform though. My app has a main html page, then uses x-chrome-tabs to create webviews as tabs.

The main page and webview use a preload file. The issue seems somewhat related to requiring/using the electron “remote” module, as I can remove that require or set enableremotemodule=“false” and the renderer process doesn’t seem to leak anymore.

I tried to use Chrome Memory profiler and compare objects before/after, but haven’t seen anything jumping out. I did see some detacted shadow roots still around, but not sure who’s holding onto the references, if that’s even related.

I tried to create a standalone app based on electron-quick-start to reproduce the issue, but I haven’t found the right combination to bring over to the example. That’s why I’m looking for tips on how to diagnose locally.


For later reference, I further isolated the issue to SharedWorkers and the remote module (not sure the linkage yet) with a sample project… I filed an issue at