Introduction
JavaScript Memory Leak Detector ( download) is a debugging tool to detect memory leaks and enforce best practices in JavaScript code when working with version of Internet Explorer older than IE8. As described in detail in this MSDN article the JScript garbage collector in previous versions of Internet Explorer manages the lifetime of JScript objects but not of DOM objects. As a result, the JScript garbage collector cannot break circular references between DOM objects and JScript objects, and memory leaks may occur.
- In IE6, these circular references are broken when the Internet Explorer process terminates (and leaks are very frequent).
- In IE7, these circular references are broken when users navigate away from the page.
- In IE8 the problem is completely mitigated. (Read here for more details).
Programmers who need to support older versions of the Internet Explorer browser should still try to pay attention to programming patterns such as JScript closures, as they could cause memory leaks.
The leak detector works hosting an IE WebBrowser control and intercepting the execution of JavaScript inside IE. It monitors al the DOM elements in the markup of a web document that somehow interact with JavaScript and presents a list of potentially leaked objects to the user, together with information about the scripts loaded in the page and, if possible, a hint to the instruction that may have caused the leak.
Installation notes
IEJSLeaksDetector is a plain, native, Windows application and does not require any particular setup (the executable can be just unzipped and run). It only runs in 32 bit versions of Windows. 64 bits editions are not supported yet.
There are only two installation steps required to make sure that the tool works correctly:
1. The tool requires that the pdm.dll script installer is installed in the machine. This DLL is normally installed with any version of Microsoft Visual Studio.In case you are unable to install Visual Studio in the target machine, a simpler way to install pdm.dll is by installing the Microsoft Script Debugger, freely downloadable here.
2. The tool also requires Internet Explorer script debugging to be enabled to work correctly. Verify that the check box "Disable script debugging (Other)" is unchecked, in IE ('Tools' menu -> Internet Options -> 'Advanced' tab -> 'Browsing' section) as shown in figure.
How to use the tool
The user can start the memory profiling of a web application navigating to the desired URL. A new tab is opened with a WebBrowser control and a tree view shows all the documents and scripts that compose the current page. When the user has finished to interact with the page he can click the "Stop" button, which causes the tool to close the control and track possible leaks. Memory leaks are listed specifying the DOM object's type and a list of "attached" JavaScript objects whose circular reference could be the cause of the leak. The tool also shows the call stack correponding to a memory leak, which represents the state of the script at the moment when the JavaScript object was attached to the DOM object. Finally, a script window highlights the exact point in the JavaScript code where the memory leak originated. More information can be found in the docs enclosed with the binaries.
|
|
http://blogs.msdn.com/gpde/pages/javascript-memory-leak-detector-v2.aspx
分享到:
相关推荐
"Visual C++ Memory Leak Detector"就是针对这类问题的工具,它可以帮助开发者检测和定位C++程序中的内存泄漏。 该压缩包文件包含了一个名为"vld-1.9d-setup.exe"的安装程序,这很可能是Visual Leak Detector (VLD)...
《Visual Leak Detector 2.23:高效精准的内存泄漏检测利器》 在软件开发过程中,内存泄漏是一个常见的问题,它可能导致程序性能下降,甚至崩溃。为了确保软件的稳定性和可靠性,开发者需要对内存泄漏进行有效的...
Visual Leak Detector是一款强大的内存泄漏检测工具,专为C++开发者设计,用于帮助找出程序中的内存泄漏问题。内存泄漏是编程中常见的错误,当程序分配了内存但未能正确释放时,就会发生内存泄漏,长时间运行可能...
Visual Leak Detector for Visual C++ 是一个专为C++开发者设计的工具,用于检测和定位内存泄漏问题。在C++编程中,内存管理是程序员的重要职责,而内存泄漏往往是导致程序性能下降甚至崩溃的关键因素。Visual Leak ...
Visual Leak Detector(VLD)是一种专为Windows平台上使用Microsoft Visual C++编译器开发的应用程序设计的内存泄露检测工具。它通过动态链接库(DLL)的形式,在运行时检查并报告内存泄露情况,帮助开发者定位并...
Visual Leak Detector是一款用于Visual C++的免费的内存泄露检测工具。相比较其它的内存泄露检测工具,它在检测到内存泄漏的同时,还具有如下特点: 1、 可以得到内存泄漏点的调用堆栈,如果可以的话,还可以得到其...
Visual Leak Detector是一款用于Visual C++的免费的内存泄露检测工具。相比较其它的内存泄露检测工具,它在检测到内存泄漏的同时,还具有如下特点: 1、 可以得到内存泄漏点的调用堆栈,如果可以的话,还可以得到其...
博客配套源码 VC++内存泄漏检测方法(3):Visual Leak Detector(VLD内存泄漏检测工具)支持VS2017 https://blog.csdn.net/libaineu2004/article/details/89763798
Visual Leak Detector.zip Visual Leak Detector for Visual C++ 2008/2010/2012/2013 http://vld.codeplex.com/downloads/get/824280
VLD 内存泄露检测工具 Visual Leak Detector 2.3.0
Visual Leak Detector,防止C++内存泄露的工具,解压后将.h文件拷贝到VC的默认include目录下,将.lib文件拷贝到VC默认的lib目录下。 使用方法:只要在包含入口函数(比如main()函数)的.cpp中包含vld.h就可以了...
"Visual Leak Detector" 是一款专为Visual C++开发者设计的内存泄漏检测工具。它通过集成到你的应用程序中,帮助你在运行时发现并定位内存泄漏问题,这对于优化代码和确保程序稳定性至关重要。 首先,dbghelp.dll是...
《Visual Leak Detector:高效精准的内存泄露检测利器》 在软件开发过程中,内存管理是至关重要的环节,尤其是在C++编程中,由于手动管理内存可能导致内存泄露的问题,这将严重影响程序的稳定性和性能。Visual Leak...
《Visual Leak Detector 1.0:轻松解决VC++内存泄漏问题》 在软件开发过程中,内存泄漏是一个常见的问题,尤其在C++编程中,由于手动管理内存,内存泄漏可能导致程序性能下降,甚至崩溃。Visual Leak Detector(VLD...
vld,全称是Visual Leak Detector,是一款开源检测内存泄露软件。 Visual Leak Detector是一款用于Visual C++的免费的内存泄露检测工具。相比较其它的内存泄露检测工具,它在检测到内存泄漏的同时,还具有如下特点:...
非常好用的内存泄露检测工具,只需不到1M的安装空间,即可在代码中进行检测内存泄露问题。
《Visual Leak Detector 1.0:一款轻量级的内存泄漏检测神器》 在软件开发过程中,内存泄漏问题一直是困扰程序员的一大难题。内存泄漏会导致程序性能下降,甚至可能导致程序崩溃,严重影响用户体验。为此,开发者们...
内存泄漏检测器 MemoryLeakDetector是由Xigua视频android团队开发的本地内存泄漏监视工具。 它具有访问简单,监视范围广,性能...leak-detector:0.0.7 '} 步骤3:添加代码以方便使用(使用广播控件不需要此步骤) //
《Visual Leak Detector:C++内存泄漏检测利器》 在C++编程中,内存管理是一项重要的任务,而内存泄漏是常见的编程错误,它可能导致程序运行缓慢、资源耗尽甚至崩溃。为了解决这个问题,开发者们引入了各种内存泄漏...