nytimes / ice

track changes with javascript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DOM node leaks

rjansen72 opened this issue · comments

We are using Tinymce and the ICE plugin in our online editor application. In our application there are multiple html elements that can be edited by clicking in them. Upon clicking in one of these elements, we load a tinymce editor along with various plugins. What we have observed is that over time memory grows unbounded and DOM nodes are leaked. After looking at this behavior via Chrome Profiles, we noticed that hundreds of ICE DOM elements were leaked each time the plugin was loaded - if even track changes was turned off. When we removed the ice plugin and re-ran our tests memory and dom node count remained consistent and didn't grow.

Anyone else seeing this?

Yes we are having the same issue. Over time, the browser slows to the point where our app is unusable and our users have to log out and close the browser to free up memory space. We love this plugin so any guidance would be wonderful!!

@rjansen72 - Thanks for the report. How do you initialize and teardown your tinymce instances? My hunch is that we need a teardown hook for ice instances which derefences object/environment globals.

@Quire - are you also instantiating and tearing down a lot of tinymce instances? I did some profiling and ice is contributing very little to memory growth when there is general editing in one instance, after the first profile. I also verified that it is not leaking any detached dom references, which was my first concern.

Hi delambo, thank you for your response. Yes, we have a report writing platform where a user could open and close many TinyMCE sections dozens, potentially hundreds, of times in their session. We just made some changes to our code to improve the issue our users were experiencing. Particularly, changes that help reduce the amount of heap space TinyMCE accumulates over multiple section edits. This makes a minor difference when TinyMCE is active, but when TinyMCE is not active it uses about 66% less memory. It also reduces the amount of memory leaked when a section is unloaded by 95%. Also ICE is only loaded on an as-needed basis. It doesn't fix everything but should make a significant difference until the issue is resolved within the ICE plugin.