从DOM中删除元素时,如何检查是否发生内存泄漏? [英] How to check if memory leak occurs when removing an element out of DOM?

查看:238
本文介绍了从DOM中删除元素时,如何检查是否发生内存泄漏?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<div id="target">
...

</div>

$('#target').html('')将删除内容,但是如何检查是否同时删除了侦听器或保存内存的其他内容?

$('#target').html('') will remove the content,but how to check if the listeners or anything else that holds memory is removed at the same time?

推荐答案

我不确定如何在JavaScript中检测泄漏(使用JavaScript).但是有可用的工具来检测JavaScript中的泄漏

I am not sure how you can detect a leak within a JavaScript (using JavaScript). but there are tools available to detect the leaks in JavaScript

  • sIEve
  • IEJSLeaksDetector2.0.1.1

这篇关于从DOM中删除元素时,如何检查是否发生内存泄漏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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