Do you know what may cause memory leaks in JavaScript?

前端 未结 5 837
星月不相逢
星月不相逢 2020-11-30 22:41

Do you know what may cause memory leaks in JavaScript? I am interested in browsers: IE 7, FireFox 3, Safari 3

5条回答
  •  旧时难觅i
    2020-11-30 23:25

    You're dealing with 2 kinds of objects (and 2 garbage collectors), javascript and DOM objects, which can reference each other (the circular reference), and then neither GC can take care of all its objects even when the page unloads. Here's a good description:

    http://getben.com/archive/2006/05/30/Resolving-JavaScript-Memory-Leaks.aspx

    http://www.josh-davis.org/2007/04/11/javascript-built-in-listeners-and-memory-leaks/

提交回复
热议问题