检测带有内置内存泄漏的IE11何时耗尽内存(1.5GB可回收池) [英] Detect when IE11, with its built-in memory leak, runs out of memory (1.5GB recyclable pool)

查看:880
本文介绍了检测带有内置内存泄漏的IE11何时耗尽内存(1.5GB可回收池)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

IE11有一个有据可查的iframe内存泄漏.在SPA中,如果您使用的是iframe,则内存将增长到约1.5GB,此后它会减速直到崩溃.

IE11 has a well-documented iframe memory leak. In a SPA, if you are using iframes the memory will grow to about 1.5GB after which time it will slow down until a crash.

我的任务是检测浏览器何时崩溃并尽快重新启动页面.该应用程序是嵌入在ASP.NET MVC中的Vue.JS.

My task is to detect when the browser is about to crash and restart the page soon enough. The application is Vue.JS that is embedded inside ASP.NET MVC.

在IE11的浏览器中可以使用哪种内存/性能检测?

What kind of memory/performance detection is available in browser in IE11?

  • 某种已使用的内存量度库?
  • 某种绩效评估库?
  • 计数创建的javascript对象吗?
  • 计数创建的iframe?

还有其他想法吗?谢谢. :)

Other ideas? Thanks. :)

来源: https://developer.microsoft.com/en-us /microsoft-edge/platform/issues/10186458/ https://developer.microsoft.com/en-us /microsoft-edge/platform/issues/8449104/ http://support.sas.com/kb/60/514.html

推荐答案

这是我最终用来检测IE11内存不足的原因.

This is what I ended up using to detect IE11 running out of memory.

主要思想: 每1秒钟计时一次.如果1秒计时器需要1分钟,我们就冻结了.

Main idea: Timer every 1 second. If 1 second timer takes 1 minute, we just froze.

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

这篇关于检测带有内置内存泄漏的IE11何时耗尽内存(1.5GB可回收池)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆