JQuery Ajax memory leaks

I saw some other posts about this, but it seems that when I make ajax calls with jquery again and again (every 30 seconds in my case), I get a memory leak. Moving from $ get to $ post (albeit a safer one) reduces the size - it still happens. Even if I have NOTHING in the answer.

Any ideas anybody?

EDIT:

Here is the code - sorry for not turning it on for 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 lead to a memory leak every time around 50 kb. What give. I have a lot of DOM code in the $ .each () function, and when I turn it on, a memory leak will jump to about 100 kb on every call. I call this function every 30 seconds using jQuery timers.

I used the $ .getJSON method, but the memory leak with this was more than 300 kb (YIKES!)

+3
2

, . ASP.NET, , ANTS. , DOM , , FireBug.

+2

.

? ?

- , DOM? ( , , !) , ?

?

jsbin jsfiddle?

0

Source: https://habr.com/ru/post/1754870/


All Articles