opened
KochiyaOcean
username_0
<!--
Thanks for opening an issue! A few things to keep in mind:

- The issue tracker is only for bugs and feature requests.
- Before reporting a bug, please try reproducing your issue against
  the latest version of Electron.
- If you need general advice, join our Slack: http://atom-slack.herokuapp.com
-->

* Electron version:
* Operating system:

### Expected behavior

<!-- What do you think should happen? -->
When `webPreferences.nativeWindowOpen` is set to true, BrowserWindows opened by `window.open`'s memory will be released after be closed.

### Actual behavior

<!-- What actually happens? -->
The memory is not released and caused memory leak

### How to reproduce
- Clone https://github.com/username_0/electron-bugs/tree/native-open-memory-leak
- Run `electron . ` in the cloned repo
- Memory usage of electron process will be increasing in task manager

<!-- 

Your best chance of getting this bug looked at quickly is to provide a REPOSITORY that can be cloned and run.

You can fork https://github.com/electron/electron-quick-start and include a link to the branch with your changes.

If you provide a URL, please list the commands required to clone/setup/run your repo e.g.

  $ git clone $YOUR_URL -b $BRANCH
  $ npm install
  $ npm start || electron .

-->
window.open with nativeWindowOpen option causes memory leak
issue
created
KochiyaOcean
username_0
Seems this issue is relative to https://github.com/electron/electron/issues/12027
comment
created
MarshallOfSound
username_1
Appears to occur on all known Electron versions with this feature 👍 Approximately 5MB per window
comment
created
GhostDev26
username_2
Still occurs on 2.0.9
comment
created
VishwasShashidhar
username_3
We've observed this on 3.0.0 as well.
comment
created
zcbenz
username_4
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.
comment
created
VishwasShashidhar
username_3
@username_4 Thanks for the details. Is there a work-around for this at the moment?
comment
closed
zcbenz
username_4
issue
created
orange4glace
username_5
I tested on the latest electron and seems it's still happening.
comment
created
orange4glace
username_5
Tested on nightly build version, (4.0.0-nightly.201) it seems it's still happening even nodeIntegration is disabled.
comment
created
KochiyaOcean
username_0
@username_5 https://github.com/electron/electron/issues/15666 seems it will be fixed in 5.0.x release.
comment