-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dom-if memory leak #5250
Comments
@madiganz Could you create a small JSBin that I can use to diagnose the issue? |
https://jsbin.com/kumoxod/edit?html,console,output This is my attempt to reproduce this in a JSBin, but it only seems to leak nodes and not any memory. The starter-kits that I used were pretty easy to reproduce the problem. Not sure if this has anything to do with chrome updates, but I never used to see Detached nodes when taking heap snapshots, but now I see them all the time. I am having a hard replicating the issue in JSBin, but in my opinion, it is very easy to replicate using the starter kit. One thing to note, is if the nodes are being restamped have a dom-if in the view, then there is a memory and node leak, without the dom-if, there is just a node leak. |
Not sure if this is as helpful, but I created a plunker to show the problem. https://plnkr.co/edit/fes5wfxP1ylWFDFH5kjz?p=preview |
Thanks for reporting this @madiganz. I believe we're seeing the same issue in our SPA. |
@TimvdLippe any news to this? I've also problems in my app that controls with dom-if are keept in memory: |
I found this issue on Polymer 2 and it still exists on Polymer 3. Both
Items in this global debouncer list cannot be removed. It causes memory leak for any elements that use this elements in their template. We need to manually execute the following statement to prevent this memory leak.
|
I'm using Polymer 2.5. and just encountered the same problem. The memory consumption is growing and growing until the page is refreshed. With a failry large application it doesnt take long for the app to become very unresponsive. |
I'm seeing the same. Is there any safe way to cleanup all those detached instances? |
@kevinpschaaf thanks! I'm wondering though if that truly fixes the mem-leak. I monkey-patched a similar fix into our app and while the memory consumption decreased after a forced gc I kept getting more and more detached nodes. Will test soon. |
[3.x] Use set and clear debouncer upon completion. Fixes #5250.
@davidsteinberger On a local test designed to stress this specific memory leak, I confirmed this results in a flat memory profile vs. the previous release. If you can repro a leak (same or otherwise), please let us know. |
@kevinpschaaf |
@kevinpschaaf why was that reverted on https://github.com/Polymer/polymer/tree/2.x? |
@Soul-Master Yes, we'll get a new release of both 2.x and 3.x out, hopefully in the next couple of days. @davidsteinberger There was an unintentional push to the 2.x branch there 🙄; the PR to the 2.x branch is in #5500 and will be merged shortly pending some last internal testing. We'll release both 2.x and 3.x together with this fix. |
@kevinpschaaf Thank you for working on this! I am sure we are all happy to have this fixed. Any updates on when this will be released for 2.x? |
[2.x] Use set and clear debouncer upon completion. Fixes #5250
Does refresh clear the memory leak in 2.5 or ONLY with 3.0? |
@nazarsa For Polymer 2, the fix for this is in 2.7.1. |
Description
dom-if
with restamp causes memory to be leaked until the window is refreshed. This does not work well with SPAs.Expected outcome
Memory to be cleaned up when the garbage collector runs after a page has been left.
Actual outcome
Memory is leaked until the page is refreshed
Steps to reproduce
Use the polymer-2 starter kit. Modify my-app.html by replacing the normal view code in
iron-pages
withInside of _routePageChanged(page): add this code after
this.page = page || 'view';
Adding this code to my-view2.html makes it easy to see the memory leak.
This was taken after switching between the views and forcing a garbage collect after landing back on view1.
Browsers Affected
Versions
The text was updated successfully, but these errors were encountered: