- 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
- 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
- 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)