Skip to content

Webview does not dispose properly #50556

Closed

Description

I am testing from the ben/editor branch that contains the changes for Grid. If you split an editor to the side and then close that editor, we now actually dispose the editor and no longer keeping it around as we used to before. This means that we now rely on the editor freeing up its resources properly.

For any webview editor (e.g. markdown preview or extensions editor) I see lots of controls still hanging around after:

  • open a single of these editors
  • split it once
  • close the second instance
  • create a heap snapshot
  • repeat split/close a couple of times
  • create a heap snapshot again
  • compare it to the first

image

Activity

  1. added
    bug
    webview
    workbench-editor-grid
    on May 28, 2018
  2. mjbvz commented on Jun 14, 2018

    @mjbvz
    Contributor

    Benjamin Pasero (@bpasero) I've fixed some of the leaks on our side but the leaks still exist. Can you take a this possible electron issue to see if you have any thoughts on the problem: electron/electron#13243

  3. bpasero commented on Jun 14, 2018

    @bpasero
    ContributorAuthor

    Matt Bierner (@mjbvz) did you test with our previous Electron 1.7.12 to see if this is a regression from the 2.0 update?

  4. mjbvz commented on Jun 14, 2018

    @mjbvz
    Contributor

    Not a regression from 1.7. I've minimized the impact of this problem. Certainly possible I'm doing something wrong in the code here

  5. added
    upstream
    electron
    on Jun 21, 2018
  6. ivankravets commented on Sep 7, 2018

    @ivankravets
  7. 4 remaining items

  8. mjbvz commented on Oct 16, 2019

    @mjbvz
    Contributor

    I investigated this again and made a few more fixes but am still blocked by the upstream electron issue.

    The best long term fix here is probably to move off of webviews and to normal iframes instead

  9. ivankravets commented on Oct 16, 2019

    @ivankravets

    How to use native iframes? Do you have example?

  10. added
    upstream-issue-linked
    on Oct 18, 2019
  11. mjbvz commented on May 6, 2021

    @mjbvz
    Contributor

    Tested using iframe based webviews using the following steps:

    1. Set "webview.experimental.useIframes": true to force iframes to be used
    2. Open a markdown file. Open the preview once and then close it
    3. Snapshot
    4. Now, multiple times: open the preview and then close it
    5. With the preview closed, take another snapshot (give GC a few seconds to run).

    You can now compare between the snapshots. Search for webview and confirm that no webview elements are still around. Make sure you are looking at the objects allocated between snapshot X and Y since there will still be some static webview objects around (such as the services):

    Screen Shot 2021-05-05 at 5 41 19 PM

  12. added
    unreleased
    insiders-released
    and removed
    unreleased
    on May 6, 2021
  13. locked and limited conversation to collaborators on Jun 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugelectroninsiders-releasedperfupstreamupstream-issue-linkedverifiedwebview

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions