0

I have a SPA application that works great without memory leaks in chrome.

However, IE11 (Windows 10) crashes every 15 minutes.

Please don't tell me IE11 is deprecated. My company supports IE11 and our customers are using IE11.

I know IFrames cause memory leaks on IE11.

I heard gifs cause memory leaks as well on IE11, Is it true?

From your experience:

  • What are the reasons that might cause IE11 to have a memory leak?
  • How to avoid those memory leaks?
  • Is there a good valid way without interrupting user experience to "release" memory leaks on IE every x minutes?

I would like to collect here all possible reasons for IE11 memory leak.

Megi Ben Nun
  • 405
  • 3
  • 6
  • 20
  • Sadly my company still supports IE11. – Megi Ben Nun Jun 02 '20 at 06:25
  • 1
    All companies with big customers (e.g. banks) support IE11. They are paying a lot, and expect you to be the best. – Megi Ben Nun Jun 02 '20 at 06:28
  • @JonathanStellwag You are correct indeed. To answer the question: the bugs are numerous and unlimited. Good luck with it. – Bart Hofland Jun 02 '20 at 06:31
  • 1
    @MegiBenNun the issue is non-trivial and you won't be able to get a solid answer. The nuances of different JS engines, and the optimizations and improvements made specifically in Chrome's V8 engine that avoids a lot of problems with memory leaks are numerous and each one a difficult concept to grasp. Some rules of thumb are to be careful with variables 9implictly or not) shared by multiple scopes and to be careful when holding DOM references. Also, it wouldn't be surprising if you had memory leaks in Chrome you just didn't notice. – user120242 Jun 02 '20 at 06:46
  • @user120242, I know it is non-trivial. Its have been 6 months since we start to release versions with tiny improvements on IE11. It is almost impossible to debug IE11 so searching a lead based on people's experience is the best lead I can have... Plus, I think it would be the best if someone will put in one place all the reasons that make IE11 specifically performance issues. It can save a lot of time to whomever run into the same issue. – Megi Ben Nun Jun 02 '20 at 06:48
  • 1
    I hope you do not feel personally attacked by me. It's not my intention to shoot the messenger. I'm just an opponent of supporting abandoned technology for eternity. I understand your position, your issues and the suggestion you make, but I'm afraid it's just futile. The code of IE has not been maintained for over ten years, I guess, and Microsoft is just keeping it barely alive. One of the biggest technical advantages of IE is the support of 3rd party ActiveX components. The financial sector relies heavily on such components, but they can cause a lot of instability within the browser as well. – Bart Hofland Jun 02 '20 at 07:13
  • I wouldn't assume it's just a problem with IE11. Chrome just happens to keep it under control with advanced heuristics. You're probably leaking under Chrome too, but the amount is small enough, or lasts for a period of time, that doesn't show noticeable impact. Using the tools under Chrome to check for leaks will probably help you to find some leaks. – user120242 Jun 02 '20 at 07:19
  • @user120242 Well, it depends... If the OP's website can be rendered on and run in Chrome (or Firefox) (or Safari) for way longer dan just 15 minutes without crashing, I guess IE11 will be the main cause of the issues anyway. And I guess that even when the site does not leak in Chrome at all, it might still crash in IE within 15 minutes... – Bart Hofland Jun 02 '20 at 07:30
  • We did already an investigation on Chrome and fixed the memory leaks on chrome... I know for a fact that on iFrames, for example, IE11 leaks badly. And there is a minor workaround to fix the issue, but there is no 100% fix for the memory leak on IE11. I'm looking for more known issues as the iFrame. I heard something about gifs and something about animations, But we don't use gifs, and maybe I will try to turn off all animations and re-test. – Megi Ben Nun Jun 02 '20 at 07:33

1 Answers1

2
  1. What are the reasons that might cause IE11 to have a memory leak?

There are many reasons that can cause the memory leaks, here we don't have any information about your SPA so it is hard for us to say what caused the memory leak in it.

I suggest you visit the following links that may give you an idea about the possible causes of memory leaks.

Memory Leakage in Internet Explorer - Revisited

Edge/Internet Explorer memory leak

  1. How to avoid those memory leaks?

The links that I have shared in the 1st point will also give suggestions to avoid the leaks.

I tried to refer to the official Microsoft docs on this topic. I found that links in those docs are broken.

Tools for Detecting Memory Leaks

JavaScript Memory Leak Detector for Internet Explorer

  1. Is there a good valid way without interrupting user experience to "release" memory leaks on IE every x minutes?

You may need to refresh the page. In some situations, it can work. Obviously, the user will be interrupted.

Here is an example:

var startTime, endTime;

function start() {
    startTime = new Date();
};

function end() {
    endTime = new Date();
    var timeDiff = endTime - startTime; //in ms
    // strip the ms
    timeDiff /= 1000;

    // get seconds 
    var seconds = Math.round(timeDiff);
    console.log(seconds + " seconds");

    if (seconds > 60)
        console.log("IE11 just froze. We need to refresh.");
}

start();

setInterval(function () {
    end();

    start();
}, 1000);

Detect when IE11, with its built-in memory leak, runs out of memory (1.5GB recyclable pool)

Deepak-MSFT
  • 10,379
  • 1
  • 12
  • 19