JavaScript Memory leakage Tool

Source: Internet
Author: User

JavaScript Memory leakage has never been paid much attention by everyone, because the impact on users is not very practical, and memory may develop rapidly in recent years. Script Memory leakage will not have a big impact.

Of course, as a front-end developer, you cannot be lucky. Memory leaks appear largely becauseProgramIs not mature and the encoding is not standardized. However, here we will not talk about how the problem occurs. If you are interested in the problem, refer to the following address:

  • Understanding and solving Internet Explorer leak patterns
  • IE's memory-leak fix greatly exaggerated
  • Memory leakage in Internet Explorer-Revisited

     

    The following describes how to use several tools to check for JavaScript Memory leakage:

    First, we use three tools: drip/sieve, JavaScript leaks detector, and leak monitor. The first two are used to check IE, And the leak monitor is used to check firefox. Here we will focus on the two tools in IE. Because Firefox's GC mechanism is stronger than IE, as long as the IE problem is eliminated, other browsers will basically not have any problems.

     

    1. Drip/sieve

    The authors of drip and sieve should be the same person, and the projects on open Souce should be the same. However, we usually use sieve, which is more powerful than drip.

    The sieve interface is very simple. The left side is embedded with a browser control. I can access any Web site and there is a memory check below, so that we can easily see the memory increase and decrease and the DOM usage curve.

    On the right panel, we can see the DOM used on the current page through show in use, and show leaks can see the memory leakage Dom. Of course, each time a page is displayed for leakage, the page must be refreshed to see the leakage of the previous page.

    At the same time, the data color on the right shows the memory increase and decrease and the specific order of magnitude.

      •  

    However, sieve performs an hack on all the Dom and judges that the Dom is not released. However, it is difficult to analyze the specific situation. It also requires some skills to track problematic Dom. It is difficult to track large applications.

     

    However, it is a good choice to check the memory usage of small modules. Especially after the modules of large projects are subdivided, it is better to test each module separately.

    Thank you for your prompt, drip/sieve:
    Http://home.orange.nl/jsrosman/

     

    2. Javascript leaks Detector

    This is a small tool from the Microsoft gpvdf team.

    Official Website: http://blogs.msdn.com/gpde/pages/javascript-memory-leak-detector.aspx

    After the installation, we can find it in the browser bar of IE browser.

     

    Jld is powerful in simulating GC and actual collection of IE6 and IE7. In this way, we can make a comparison.

    Generally, we can only reflect the ideal situation of IE6 and IE7. We need to select the following actual leaks to reflect the actual situation of the current browser.

     

    After refreshing the browser, we can see the result of the previous page. Green indicates no memory leakage, red indicates Memory leakage, blue indicates the page currently loaded, and black, of course, indicates the webpage being loaded.

    When we expand a problematic page,

    We can see a problematic branch leaks. The problematic nodes are listed here, And the problematic scripts are also listed.

     

    This is very convenient for us to identify the cause of the leakage. However, to use script debugging, you must enable the script debugging function of IE.

    In the advanced ie options, we can remove the two hooks.

     

     

    3. Leak Monitor

     

    This is the only tool on Firefox to check for Memory leakage, but it is not recommended here. Because Firefox's memory GC mechanism is more powerful than IE, it does not have to be taken into consideration. As long as the IE problem can be solved, there is basically no problem in Firefox. In addition, with the help of the two powerful software, ie can basically solve most of the problems.

     

    It's a pity that this tool has a bad experience, which can make people feel crazy. If you want to continue, you can download: https://addons.mozilla.org/zh-CN/firefox/addon/2490

     

    PS: the original post address is unknown

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.