Sorry, 忘记写地址了
http://groups.google.com/group/ajaxpro/browse_thread/thread/614eaa13409becf/dd79b87d1375204c?lnk=st&q=AJAX+Memory+Leak%3F&rnum=1#dd79b87d1375204c

解决方案 »

  1.   

    我靠,我发现Google论坛格式简单,用起来很舒服,而且速度快。
      

  2.   

    作国简单的AJAX.NET程序。你说的没作国。
      

  3.   

    使用简单的Sajax就是了
    那个好多了
      

  4.   

    找到了一个解决的帖子:
    Michael, 
    I know why there are memory leaks in apps such as Chat (which I just 
    worked on using your Ajax.NET).  I found it in the common.js that is 
    generated by the dll.  There is a bug that causes NEW xmlhttprequests 
    to ALWAYS be added to the collection.  The reason is that in 
    "ajax_create_request" the line that reads: 
    if(requests[i].readyState == 4) 
    should read: 
    if(requests[i].obj.readyState == 4) 
    and the line that reads: 
    requests[i].abort(); 
    should read: 
    requests[i].obj.abort(); 
    If not, the collection will NEVER find an "unused" request, and will 
    build a new instance of the XMLHttpRequest object for every single 
    call.  I changed the code (see below) in common.js and I have no more 
    memory leak. 
    See the code diff below for the fix: 
    ================================== 
    BEFORE: 
    function ajax_create_request(context) 

            for(var i=0; i<requests.length; i++) 
            { 
                    if(requests[i].readyState == 4) 
                    { 
                            requests[i].abort(); 
                            requests[i].context = null; 
                            return requests[i]; 
                    } 
            } 
            var pos = requests.length; 
            requests[pos] = Object(); 
            requests[pos].obj = new XMLHttpRequest(); 
            requests[pos].context = context; 
            return requests[pos]; } 
    ==================== 
    AFTER: function ajax_create_request(context) 

            for(var i=0; i<requests.length; i++) 
            { 
                    if(requests[i].obj.readyState == 4) 
                    { 
                            requests[i].obj.abort(); 
                            requests[i].context = null; 
                            return requests[i]; 
                    } 
            } 
            var pos = requests.length; 
            requests[pos] = Object(); 
            requests[pos].obj = new XMLHttpRequest(); 
            requests[pos].context = context; 
            return requests[pos]; 但谁知道哪有修正后的Ajax.dll可下载的?
      

  5.   

    找到了一个解决此问题的帖子,
    但有谁有修正后的 Ajax.dll呢? 因为客户端的一个common.ashx,是Ajax.dll自动生成的,其中的js代码改不了. 谁知道的话给我发一份修正后Ajax.dll啊,不甚感谢.  [email protected]
    I know why there are memory leaks in apps such as Chat (which I just 
    worked on using your Ajax.NET).  I found it in the common.js that is 
    generated by the dll.  There is a bug that causes NEW xmlhttprequests 
    to ALWAYS be added to the collection.  The reason is that in 
    "ajax_create_request" the line that reads: 
    if(requests[i].readyState == 4) 
    should read: 
    if(requests[i].obj.readyState == 4) 
    and the line that reads: 
    requests[i].abort(); 
    should read: 
    requests[i].obj.abort(); 
    If not, the collection will NEVER find an "unused" request, and will 
    build a new instance of the XMLHttpRequest object for every single 
    call.  I changed the code (see below) in common.js and I have no more 
    memory leak. 
    See the code diff below for the fix: 
    ================================== 
    BEFORE: 
    function ajax_create_request(context) 

            for(var i=0; i<requests.length; i++) 
            { 
                    if(requests[i].readyState == 4) 
                    { 
                            requests[i].abort(); 
                            requests[i].context = null; 
                            return requests[i]; 
                    } 
            } 
            var pos = requests.length; 
            requests[pos] = Object(); 
            requests[pos].obj = new XMLHttpRequest(); 
            requests[pos].context = context; 
            return requests[pos]; } 
    ==================== 
    AFTER: function ajax_create_request(context) 

            for(var i=0; i<requests.length; i++) 
            { 
                    if(requests[i].obj.readyState == 4) 
                    { 
                            requests[i].obj.abort(); 
                            requests[i].context = null; 
                            return requests[i]; 
                    } 
            } 
            var pos = requests.length; 
            requests[pos] = Object(); 
            requests[pos].obj = new XMLHttpRequest(); 
            requests[pos].context = context; 
            return requests[pos];