刷新IE6内存泄漏? [英] IE6 Memory Leak on Refresh?

查看:83
本文介绍了刷新IE6内存泄漏?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我每隔几秒钟重新加载一个页面以从服务器获得更新,这个页面可以打开,这可以永远发生 - 我猜,特别是因为这个浏览器是在一个没有关闭的远程服务器上。 / p>

我这样做:

  setTimeout(function(){
location.href = location.href; //强制从服务器重新加载$ ​​b $ b},1000 * 10 * 0.5);

我注意到IE6的内存使用量不断增加和增加。该页面除了刷新和显示html之外什么都不做。



为什么会发生这种情况?我怎么能解决这个问题呢?我不想让IE6崩溃。



它的价格为435,000K,大概是30分钟。



全部谢谢



更新



对不起大家 - 我确实有另一个功能,每次加载页面时都会运行:

  function recreateTicks(tasks){

if(tasks!=''){

var myTicks = tasks.split(',');

var length = myTicks.length;

for(var i = 0; i< length; i ++){

var element = myTicks [i];

$('#'+ element).attr('checked',true);

}

}

}

以上是否有问题?循环引用??



更新2



上面的函数调用如下:

 < script type =text / javascript> 
<! - PHP生成 - >
var tasks ='ab_1,ab_2,ab_3';
< / script>
< script type =text / javascript>
$(document).ready(function(){
recreateTicks(tasks);
});
< / script>


解决方案

好的,这有点争议,但为什么不呢让IE6崩溃?



你最终可能将大部分开发时间都用在IE6问题上 - 这是一个充其量迅速萎缩的市场。虽然它在企业领域严峻地存在,但无论如何,其余的用户都被大量糟糕的软件严重锁定。那些IE6用户会越来越认为他们的PC设置不合标准(而且是)。



为什么不让那些IE6用户崩溃?他们只会看到他们的PC越来越慢,而错误信息(当它出现时)是一个IE,而不是一个页面。



有很多100%以客户为导向的质量方法的价值,开始让这些用户像这样自生自灭是危险的,但对你来说重要的平衡是开发成本与奖励。



除非这些IE6用户(其浏览器始终崩溃)会注意到您的应用程序存在问题并且有能力阻止您销售它,那么您的开发成本加倍会对您有什么价值?



最后,如果你真的想让IE6无泄漏那么就不要使用jQuery了。从头开始编写所有Javascript,并观看范围和各种IE6 DOM错误,如鹰。 jQuery使用扩展属性(在IE6中总是泄漏)并隐藏了一些你需要微管理的范围问题,如果你想让IE6不泄漏的话。


I reload a page every few seconds to get an update from the server, this page can be open and this can happen forever - I am guessing, espcially since this browser is on a remote server which isn't turned off.

I do this:

setTimeout(function () {
        location.href = location.href; // forces a reload from the server
    }, 1000*10*0.5); 

I have noticed that IE6's memory usage keeps increasing and increasing. The page does nothing apart from the refresh and display html.

Why does this happen? How can I over come this problem? I don't want to crash IE6.

Its at 435,000K and it has been about 30 minutes.

Thanks all

Update

Sorry everyone - I do have another function which runs every time the page is loaded:

function recreateTicks(tasks){

 if(tasks!=''){

  var myTicks = tasks.split(',');

  var length = myTicks.length;

  for(var i=0; i<length; i++){

   var element = myTicks[i];

   $('#'+element).attr('checked', true);

  }

 }

}

Anything wrong with the above? Circular reference??

Update 2

The above function is called like this:

<script type="text/javascript">
<!--PHP Generated-->
var tasks = 'ab_1, ab_2, ab_3';
</script>
<script type="text/javascript">
$(document).ready(function(){     
recreateTicks(tasks);
});
</script>

解决方案

Ok, this is slightly controversial, but why not just let IE6 crash?

You can end up putting the majority of your development time into IE6 issues - a rapidly dwindling market at best. While it holds on grimly in the corporate space the remaining users are horribly locked down with lots of poor software anyway. Those IE6 users will increasingly have the perception that their PC setup is sub-standard (and it is).

Why not just let those IE6 users crash? They'll just see their PC get slower and slower, and the error message (when it comes) is an IE one, not an in-page one.

There's lots of value in a 100% customer driven approach to quality, and it's dangerous to start letting these users fend for themselves like this, but the important balance for you is development cost vs reward.

Unless these IE6 users (whose browser crashes all the time anyway) will notice that your app is the problem and have the power to block you selling it then what's the value to you in doubling your development costs?

Finally, if you really want IE6 leak free then don't use jQuery. Write all your Javascript from scratch and watch your scopeing and various IE6 DOM bugs like a hawk. jQuery uses expanded attributes (which always leak in IE6) and hides some of the scope issues that you really need to micro-manage if you want IE6 to not leak.

这篇关于刷新IE6内存泄漏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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