Permalink
Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign up
Fetching contributors…
Cannot retrieve contributors at this time.
Cannot retrieve contributors at this time
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| </head> | |
| <body> | |
| <h4>Memory Leak Demo 3</h4> | |
| <button onclick="start()">Start</button> | |
| <div id="p"></div> | |
| <script type="text/javascript"> | |
| function start() { | |
| var p = document.getElementById("p"); | |
| detached = document.createElement("div"); | |
| p.appendChild(detached); | |
| p.removeChild(detached); | |
| fill(); | |
| } | |
| function fill() { | |
| for (var i = 0; i < 25; ++i) { | |
| var div = document.createElement('div'); | |
| div.data = new Array(10000); | |
| for (var j = 0, l = div.data.length; j < l; ++j) { | |
| div.data[j] = j.toString(); | |
| } | |
| detached.appendChild(div); | |
| } | |
| } | |
| </script> | |
| </body> | |
| </html> |