You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
window.open with nativeWindowOpen option causes memory leak #12634
From the profile of heap allocations, it seems that the V8 contexts of the new windows have never been released, resulting in a leak of V8 contexts in the renderer process of the embedder page.
A theory for this leak is: since we don't release Node environment when a page is destroyed (because of crashes), the V8 context of the pages become persistent in memory.
This is kind of expected behavior since the leak is intended, and it is also part of the reasons why we restart renderer process for every page navigation. The nativeWindowOpen option actually violates the design of Electron's Node integration model.
The simplest fix should be disabling Node integration for the new windows, but it would be a breaking change.
Reacted by Vishwas Shashidhar, 東風谷オーシャン and Thomas Moutel
Activity
KochiyaOcean commentedon Apr 17, 2018
Seems this issue is relative to #12027
MarshallOfSound commentedon Apr 26, 2018
Appears to occur on all known Electron versions with this feature 👍 Approximately 5MB per window
KochiyaOcean commentedon May 6, 2018
Still occurs on 2.0.0 stable
GhostDev26 commentedon Sep 17, 2018
Still occurs on 2.0.9
VishwasShashidhar commentedon Sep 26, 2018
We've observed this on 3.0.0 as well.
zcbenz commentedon Oct 10, 2018
From the profile of heap allocations, it seems that the V8 contexts of the new windows have never been released, resulting in a leak of V8 contexts in the renderer process of the embedder page.
zcbenz commentedon Oct 10, 2018
A theory for this leak is: since we don't release Node environment when a page is destroyed (because of crashes), the V8 context of the pages become persistent in memory.
This is kind of expected behavior since the leak is intended, and it is also part of the reasons why we restart renderer process for every page navigation. The
nativeWindowOpenoption actually violates the design of Electron's Node integration model.The simplest fix should be disabling Node integration for the new windows, but it would be a breaking change.
VishwasShashidhar commentedon Oct 12, 2018
@zcbenz Thanks for the details. Is there a work-around for this at the moment?
Edit: Never mind, I just saw that a PR was raised to fix this issue for when nodeIntegration is disabled in the child window.
orange4glace commentedon Nov 27, 2018
Tested on nightly build version, (4.0.0-nightly.201) it seems it's still happening even nodeIntegration is disabled.
KochiyaOcean commentedon Nov 27, 2018
@orange4glace #15666 seems it will be fixed in 5.0.x release.