Simple jQuery Ajax call leaks memory in Internet Explorer

后端 未结 8 785
小鲜肉
小鲜肉 2020-12-02 20:33

I created a web page that makes an Ajax call every second. In Internet Explorer 7, it leaks memory badly (20 MB in about 15 minutes).

The program is very simple. It

相关标签:
8条回答
  • 2020-12-02 20:49

    Just encountered this myself. I thought it was something to do with the UI library initially, but then it disappeared after I swapped in jQuery 1.5. for the version 1.4.2 that I was using. (1.4.4 didn't seem to fix the issue).

    0 讨论(0)
  • 2020-12-02 20:55

    I've seen this, and I don't believe it's a memory leak per-se. It's just that the Ajax request returns with no data because of caching.

    Add deliberate cache control, as in:

    $.ajax({ url: 'http://xxxxxxxxxxxxxx/test', // The url returns an empty string
             dataType: 'html',
             cache: false,
             success: function(data){}
        });
        setTimeout('testJunk()',1000)
    

    It's one of those things where stuff falls down the cracks, that is, does a specific thing with caching and XMLHttpRequest and jQuery doesn't use cache off by default.

    0 讨论(0)
提交回复
热议问题