I am definitely not the first person to have a jQuery memory leak issue, but I couldn't find the answer I was looking for the many questions similar to this one that I looked at.
First, the leaky bit:
$(document).ready(function ivr_grabber(){
var xhr = $.ajax({
url: '/ivr/inprogress',
timeout: 3000,
success: function(data){
$('#open-ivrs').html(data);
data = null;
},
complete: function(){
setTimeout(ivr_grabber, 3000);
}
});
xhr = null;
});
The PHP code returns a table with some people who are being called by our PBX. I've commented out the .html(data) line, and it's made no difference. I've also removed setTimeout, and then put it back, no luck. I attempted to unset all the values that might be incurring this leak, but I cant figure out where it's coming from.
It appears to be leaking at a rate of about 5 KB per ajax call. Any thoughts?
Using jQuery 1.7.2 on chrome
I've been taking heap snapshots consistently, none of the above have affected the leakiness