Memory leakage means that a piece of allocated memory can neither be used nor recycled until the browser process ends. Due to a bug in the browser garbage collection method, memory leakage may occur, below we will discuss in detail several cases of Memory leakage: Memory leakage means that a piece of allocated memory can neither be used nor recycled until the browser process ends. In C ++, memory leakage is often caused by manual memory management. Currently, popular languages such as C # and Java use the automatic garbage collection method to manage memory. Normally, there will be almost no memory leakage. The browser also uses the automatic garbage collection method to manage memory. However, memory leakage may occur due to a bug in the browser garbage collection method.
1. When an element on the page is removed or replaced, if the event bound to the element is still not removed, it will not be properly handled in IE. In this case, manually remove the event first, otherwise, memory leakage may occur.
The Code is as follows: