-
Notifications
You must be signed in to change notification settings - Fork 131
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
iron-list (v2) crashes chrome (out-of-memory exception) when working with large lists #518
Comments
The list will reliably crash with 16k elements. |
My current workaround is to check if an incoming list is large (> 15k) and then blank out the list before supplying the new data. |
I don't seem to suffer from this via this JSBin: https://jsbin.com/lolekifale/4/edit?html,console,output It splices 50K items onto the list with no problem as many times as I like. Have I missed something in your issue description? Is it possible it has something to do with the elements you're posting into the |
It could be due to the list elements being serialized by a protobuf. I'll test again and report back. |
Okay, so the object size shouldn't matter (mine are about 230Bytes) In your jsbin, change the click listener from: to
jsbin will crash on click |
Very interesting. I'd definitely say that's an issue to bring up with the main Polymer repo, though I'm not sure you'll get much of an answer as it seems like an issue that can be worked around by not doing that. In the realm of
or
To achieve what you're noting here. |
Gotcha. In our app we are just assigning server-returned data into a reference that is bound to the list (via the template). You'd recommend not directly assigning the object in, but instead binding the list to a display array, and then using the splice syntax to clear and replace its content when the server-data comes in. Correct? I think two fixes might be in order.
|
I'd suggest in that case you use the
approach as opposed to Good call on number 2 with the issue up to Polymer, that's most likely the same issue you'd need for number 1 as |
Awesome. I'll go with that for now. I filed a parallel bug here: |
Description
I'm using
iron-list
(v2) to render lists of log data over time. Depending on how noisy the entity being monitored is, the list can grow quite large.I've found after supplying two lists of 30k+ elements to the iron list, the browser crashes.
This is likely due to the list's use of array-splice.html, which uses a Levenshtein edit distance function (calcEditDistances) to determine which elements need replacing.
The function creates an NxN array as it workspace, which for a 30,000 element list becomes a 900,000,000 entity grid, and consumes 1gig of heap.
Relevant code in array-splice.html:
Expected outcome
Since the list was working in v1.x, the iron list should still take whatever I throw at it.
Actual outcome
Browser crash.
Live Demo
I'm not at liberty to share
Steps to reproduce
iron-list
element in the page, with a really simple template, a la:Note: You can omit any template bindings in the row div.
Browsers Affected
The text was updated successfully, but these errors were encountered: