Bug Tracker

Modify

Ticket #10044 (closed bug: duplicate)

Opened 22 months ago

Last modified 14 months ago

jquery - ajax with memory leak

Reported by: roberto@… Owned by: roberto@…
Priority: low Milestone: None
Component: ajax Version: 1.6.1
Keywords: Cc:
Blocking: Blocked by:

Description

hi guys i'm running a simple 'refresh' with ajax and i'm getting a memory grow without understanding why check if i'm wrong or if i'm doing a wrong memory clean

running in firefox and i.e. i get a memory growing running on google chrome don't :/

i'm using jquery 1.6.1 and php script that return a blank page when ?frame=1

the javascript execute a ajax that return a blank page (?frame=1) and sum +1 on a success counter, and +1 on a error counter when sucess/error, after ajax complete (erro/sucess) it resend the ajax request

after +- 10000 requests memory jump from 43 MB to 85MB in firefox (running firefox 5.0.1) at chrome it work with 33-45 and never grow with +- 20000 request chrome continue with 33-45 mb and firefox get 130MB

check the link (it's a ziped file) www.spadim.com.br/bug.jquery.zip

thanks guys

Change History

comment:1 Changed 22 months ago by roberto@…

this is the same as Ticket #9715

i couldnt save at jsfiddle but put this code at html and press run:

<script language='javascript'>
var contador=0;var last_contador=0;
var contador_erro=0;
var contador_sucess=0;
var velocidade='';
function tmp_tempo(){
    velocidade=(contador-last_contador);
    last_contador=contador;
}
function show_error(){contador_erro++;}
function show_sucess(){contador_sucess++;}
function get_values(){
    jQuery.ajax({
            type: "GET",
    url:"/echo/blank", // if i could change it to a blank page, could memory leak faster...
            data:"frame=1",
            dataType:"text",
            cache:true,
            complete:show_values,
            error: show_error,
            success: show_sucess
        });
}
function show_values(){
    get_values();
    contador++;
    document.getElementById('conta').innerHTML="contador:"+contador+" [erro: "+contador_erro+", sucess: "+contador_sucess+"], velocidade: "+velocidade+"/s";
}
get_values();    // start loop...
tmp_tempo();
setInterval("tmp_tempo()",1000);
</script>
<span id='conta'></span>
</body>
</html>

comment:2 Changed 22 months ago by anonymous

i got this link at jsfiddle could you check if it's ok? i never used fiddle before  http://jsfiddle.net/vBJXK/

comment:3 Changed 22 months ago by addyosmani

  • Owner set to roberto@…
  • Priority changed from undecided to low
  • Status changed from new to pending
  • Component changed from unfiled to ajax

Could you let us know how you're detecting the memory leak?

comment:4 Changed 22 months ago by roberto@…

  • Status changed from pending to new

i'm running windows process manager (with firefox, i.e.) and checking memory usage after some minutes

on google chrome i'm using the google chrome task manager that show memory usage

comment:5 Changed 22 months ago by roberto@…

on some tablets (android) i execute it on default android webbrowser and it stop browser after some hours (no more memory), ok i don´t know what engine the default browser run, but maybe a variation of webkit webkitgtk or another one, maybe gecko... but let´s focus on firefox,midori,internet explore,safari,google chrome, since i´m using it on desktop for now

comment:6 Changed 21 months ago by dmethvin

  • Status changed from new to closed
  • Resolution set to duplicate

comment:7 Changed 21 months ago by dmethvin

Duplicate of #10013.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.