[Alex original article, the post must indicate the article link! Today, I saw a friend on the BBS and posted a problem that the JavaScript directory tree control program memory could not release, reminds me of the article on the Internet to see an article about the JS memory management mechanism, and I forgot to be almost If you only remember: refresh the page does not cause JavaScript recycling memory, minimizing the window will cause memory recycling! So I decided to be a test to observe the minimum window memory will not really be recycled! The process is as follows:
Press CTRL Alt DEL key button to open "Task Manager", go to "Process" page (in order to use it easy to observe, point option menu, select "front-end display" (front tick)). Open http://www.9499.net homepage, and pay attention to observe the CPU and internal change IExplorer.exe process, right-click on the directory tree menu on the left side of the home page, select "Refresh", observe the IExplorer of CPU and memory changes .exe process, determine that the process is the process we have to track. Repeat a few times, each time the memory usage of the corresponding process will increase by 2 ~ 3m, the next point minimize, pay attention to the memory usage of the IE to fall, I saw it here, I saw it from 50m. Falling around 1m, then pick up! This test is verified: refreshing pages will not cause JavaScript recycling memory, minimizing windows will cause memory recycling!