An interesting experiment on memory usage of javascript programs

Source: Internet
Author: User

[Alicloud originalArticle, The post must specify the source of the article link!]

Today, I saw a friend posted a post on the BBS about the Javascript directory tree control.ProgramMemory usage cannot be released, which reminds me of an article about the JS memory management mechanism I saw online some time ago. I forgot about the content and only vaguely remembered: refreshing the page does not cause JavaScript to recycle memory. Minimizing the window will cause memory to be recycled! So I decided to perform a test to see if the minimum window memory will be recycled! The process is as follows:

Press CTRL + ALT + DEL to open the "Task Manager" and go to the "process" Page. (to facilitate observation, click the Options menu, select "front-end display" (checked above )). Open the main page of the http://www.9499.net, observe the CPU and the change in the icycler.exe process at the same time, right-click the directory tree on the left of the home page, select "refresh", observe CPU and memory change icycler.exe process at the same time, determine that the process is the process we. Refresh several times. The memory usage of the corresponding process is increased by 2 ~ 3 M. Next, minimize the number. Check whether the memory usage of IE has suddenly fallen. What I see here is that it has suddenly fallen from 50 m to about 1 m, and then rebounded!
This experiment demonstrates that refreshing the page will not cause JavaScript to recycle the memory. Minimizing the window will cause memory collection!

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.