I’ve seen some other posts on this, but it appears that when i do ajax calls with jquery over and over again (every 30 seconds in my case), I get a memory leak. Changing from a $get to a $post (whilst more secure as well) cuts down on the size – it still happens. Even if I do NOTHING in the response.
Any ideas anyone?
EDIT:
Here is the code – sorry for not including it the first time….
$.post("Home/GetDashboard", { monitorDate: monitorDate }, function(data) {
$.each(data, function() {
// this code has been removed to help isolate leak
});
}, 'json');
This will cause a memory leak each time of around 50 kb. That’s give or take. I have a lot of DOM code in the $.each() function and when I include that, the memory leak jumps to about 100 kb with each call. I am calling this function every 30 seconds using jQuery timers.
I was using the $.getJSON method, but the memory leak with that was more like 300 kb (YIKES!)
You need to determine which process is growing. If its ASP.NET then you can run a memory profiler such as ANTS. If your browser process is continuing to grow then you need to assess the DOM and find out what’s happening with a tool like FireBug.