You can view the simple testing page here
The page contains one textarea, a "create" button and a "remove" button. When the "create" button is clicked, the "textarea" is used to create "wysihtml5". When the "remove" button is clicked, the "wysihtml5" is removed with the code below:
$("iframe.wysihtml5-sandbox, input[name='_wysihtml5_mode']").remove();
$("body").removeClass("wysihtml5-supported");
(Please refer to this for reference.)
The problem I am having is that the memory of the elements(textarea, iframe, and links) created by wysihtml5 seem to be retained in the memory.
I take few heap snap shots with google chrome dev tool.
- snap1 - when the page is initially loaded
- snap2 - after the wysihtml5 is created
- snap3 - after the wysihtml5 is removed
Are there memory leak? If there are, how do I prevent it from happening? (My backbone application can possibly create/destroy 100+ wysihtml5, so a clean removal of wysihtml5 is quite important!)