I've been racking my brain for the past four days, I've searched, and searched, and found nothing useful. Why does the code below cause a massive memory leak? (400 requests - 130,000 KB)
canLoop = true;
cb = function(){};
xhr = new XMLHttpRequest();
xhr.onreadystatechange = function(){
if(xhr.readyState==4){
cb();
}
};
function Loop(){
if(canLoop){
xhr.open("GET","http://www.roblox.com/User.aspx?id=48103520",true);
xhr.send();
}
}
cb = function(){
console.log(xhr.status);
setTimeout(Loop,1);
};
Loop();
Please help, I can't understand why this causes a leak. Yes, I did see this thread, and it doesn't appear related. - Memory Leak with an XMLHttpRequest and setInterval Couldn't solve my issue with it, anyway.
Any ideas?