TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

JavaScript memory leak patterns

32 点作者 BudVVeezer超过 15 年前

3 条评论

cscotta超过 15 年前
This article is a good description of circular references and memory leaks in JS, a pattern which is especially common in IE6 and one which my coworkers have spent a surprising amount of time combatting. Memory leaks border on a special kind of hypochondria, but once you can prove they exist, they're a bear to track down.<p>The biggest surprise in this article, however, was in the bio:<p>_"He has worked as a part of the OS/2 IBM Web Browser Support Team for the past three years."_<p>The OS/2 Web Browser was Mozilla-based, with open development happening in the free WarpZilla project. Apparently WarpZilla, a port of Firefox to OS/2, is still going strong as of version 3.5.4 (with prereleases of Fx3.6 and Fx3.7 still available): <a href="http://www.mozilla.org/ports/os2/" rel="nofollow">http://www.mozilla.org/ports/os2/</a>
cbetz超过 15 年前
Please correct me if I am wrong, but shouldn't developers only worry about the issues mentioned in the article on older browsers? (I'm thinking IE6 and earlier).<p>Introducing a leak via circular references would be considered a bug in most modern JS engines, right?<p>A related question: Can someone recommend a good plugin/extension for monitoring the size of a page's javascript memory usage over time?
评论 #1108836 未加载
评论 #1108790 未加载
Plugawy超过 15 年前
One more way of avoiding memory leaks is event delegation - here's quite good article about it: <a href="http://www.sitepoint.com/blogs/2008/07/23/javascript-event-delegation-is-easier-than-you-think/" rel="nofollow">http://www.sitepoint.com/blogs/2008/07/23/javascript-event-d...</a>