jQuery server ping slowly but surely filling memory?

Posted by danspants on Stack Overflow See other posts from Stack Overflow or by danspants
Published on 2010-06-17T00:26:34Z Indexed on 2010/06/17 0:32 UTC
Read the original article Hit count: 353

Filed under:
|
|
|

I use the following piece of code to test if our server is running whilst the user is in a page. I've also started adding other functions that grab small amounts of data that are constantly changing and are to be relayed to the user (Files waiting for download, messages, reports etc).

I've noticed recently that if I leave any page open (all pages contain the same function), the browser takes up more and more system memory which I can only attribute to this regular task (overnight it reached 1.6 gb). Is there some way of clearing out the data that is being accumulated? Is this normal behaviour? As far as i can tell, every time I call the function it should overwrite the previously retrieved data?

function testServer(){

        jQuery.ajax({
        type:"HEAD",
        url:"/media/d_arrow_blue.png",
        error: function(msg)
        {
            jQuery.jGrowl("Server Disconnected");
        }

        });
        //retrieves count of files awaiting download - move to seperate function
        jQuery.get("/get_files/",{"type":"count"},function(data)
        {
            jQuery("#downloadList").children("div").text(data);    

        });
    };

    jQuery().doTimeout(6000,function() {

        testServer();
        return true;
    });

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery