内存泄漏
2016-01-26 11:34
330 查看
memory allocation : object 创造时
memory free : 当没有 reference 指向该object 时
当浏览器执行时,需要维护来自DOM的大量对象,IE使用自己的垃圾回收机制,而这个机制和javascript不同,这就导致内存泄漏的发生。
内存泄漏
A memory leak in JavaScript most commonly occurs when there are DOM nodes that are not reachable from the page’s DOM tree, but are still referenced by a JavaScript object.
And later, you remove the element from the display list:
As long as
exists, the DOM element referenced by message will not be removed, even though it is now detached from the page’s DOM tree.
memory free : 当没有 reference 指向该object 时
当浏览器执行时,需要维护来自DOM的大量对象,IE使用自己的垃圾回收机制,而这个机制和javascript不同,这就导致内存泄漏的发生。
内存泄漏
A memory leak in JavaScript most commonly occurs when there are DOM nodes that are not reachable from the page’s DOM tree, but are still referenced by a JavaScript object.
email.message = document.createElement(“div”); displayList.appendChild(email.message);
And later, you remove the element from the display list:
displayList.removeAllChildren();
As long as
exists, the DOM element referenced by message will not be removed, even though it is now detached from the page’s DOM tree.
相关文章推荐
- xcode 左边导航栏中,类文件后面的标记“A”,"M","?"……等符号的含义???
- Eclipse CDT gcc 报错 对‘exp’未定义的引用
- 超全!整理常用的iOS第三方资源
- USB中CDC-ECM的了解和配置
- nodeType
- 文章标题
- Django学习笔记之——Models
- python模块系列之 - re
- 谈谈深度学习中的 Batch_Size
- Spring事务异常回滚,捕获异常不抛出就不会回滚
- 敏捷的前提
- Qt json解析
- 收集的几个好用的maven mirror
- 事件冒泡 模型
- Get UTI (uniform type identifier) and ContentType
- 一个人的命运决定于晚上8点到10点之间【认真看完本篇文章,你的人生将会有所改变】
- 深度学习与自然语言处理之四:卷积神经网络模型(CNN)
- nyoj--709
- MAVEN库、常用命令
- java.lang.OutOfMemoryError:GC overhead limit exceeded解决方法