ngSanitize 1.5.0 triggers Internet Explorer memory leak #13800
Description
The changes from v1.4.8 to v1.5.0 of angular-sanitize triggers a memory leak in our project. When using Internet Explorer 11 with other javascript libraries each pageload will increase the memory usage, until the browser stop working. I've put together an example project which just have the minimum amounts of script tags in the header to reproduce the problem. Every time I refresh the page Internet Explorer 11 will leak memory, and will eventually (at around 1.2GB memory usage for me) get random renderer and javascript errors. If I remove either of "es6-shim.js", "kendo.all.min.js", or "angular-sanitize.js" the memory leak wont happen. In the example project I have simplified the angular-sanitize code as much as I could to show what functionality is triggering the memory leak for me.
(As the file attachment seems to be broken, here is a link to the example project: https://dl.dropboxusercontent.com/u/775659/Leaker.zip)
Notes:
- If the IIFE in my simplified script is removed the memory leak wont happen.
- If "createHTMLDocument" isn't called in an inner function the leak wont happen.
- If "documentElement" isn't accessed on the newly created HTML document the leak wont happen.
- If an angular module isn't registred the leak wont happen.
- When changing any of the conditions, for example using angular-sanitize v1.4.8, memory usage could of course still increase. The difference being that the memory is temporary, will be capped, and will clear if you go to another page. In my example project the leak wont cap, and will remain even if you leave the page.