We build complex enterprise application using KnockoutJS and faced poor performance especially in IE8. Application might take more than 1GB of RAM and never frees memory. During investigation we discovered that KnockoutJS keeps references to the DOM nodes and never deletes it. This can be reproduced using IESieve against any public KnockoutJS example, just watch DOM utilization while playing with example which adds and deletes DOM nodes.
Have anyone faced this problem and has any ideas of how to work this out?
We had faced similar issues with knockout JS on IE 8. One of the problem areas was having an observable array (with 500+ elements) and building a UI (imagine a table like or list like structure) with all of those. The only work around that worked for us was to change the view model so that it contains only very few items that could fit on the screen. Also, we had to add handlers for scroll events so that the observable array would keep getting refreshed. And (not too proud of this), we had to add an empty div at the top of the displayed records to give an illusion of the view having scrolled.
Probably to do with event bindings not being released when their DOM elements get deleted. If it's something thats happening under the hood with knockout, you will have to patch and submit a pull request.
I've had this kind of thing happen a lot with backbonejs too. JavascriptMVC is a bit better for cleaning up after itself.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With