In my company, we are working on SPA with several frames. Sometimes some of the frames did not load in IE 11 because IE ran out of memory (iframe content could be pretty heavy for RAM, but everything is fine with Chrome and FF).
In fact, we tracked the fact that every time we reload the page, the used memory (data taken from the IE memory analyzer or the Windows task manager) continued to grow until it reached the 1.6 GB threshold.
I found this very interesting post , and I thought that all my problems would fly away. Since we are not using jQuery, I adapted this provided fragment to vanilla JS. My idea was to clear the frames before reloading the page to check if the used memory would be fixed.
Here is the code I wrote:
window.addEventListener('beforeunload', function () { [].slice.call(document.querySelectorAll('iframe')).forEach(function (frame) { // remove all frame children while (frame.contentWindow.document.body.firstChild) { frame.contentWindow.document.body.removeChild(frame.contentWindow.document.body.firstChild); } frame.src = 'about:blank'; frame.parentNode.removeChild(frame); }); // force garbarge collection for IE only window.CollectGarbage && window.CollectGarbage(); });
Then I opened the IE memory profiler and reloaded the application. However, very little memory was fixed, and I got something like a memory chart
I'm missing something. Is there any information or advice?
Thanks.
source share